Commit cd729356 authored by Rajeshekar's avatar Rajeshekar

MT-55: Charts

parent dee0916e
......@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Account;
import com.nisum.mytime.model.Designation;
import com.nisum.mytime.model.EmployeeLocationDetails;
import com.nisum.mytime.model.EmployeeRoles;
import com.nisum.mytime.model.Location;
import com.nisum.mytime.model.MasterData;
......@@ -85,6 +86,15 @@ public class UserController {
return new ResponseEntity<>(employeesRole, HttpStatus.OK);
}
@RequestMapping(value = "/getEmployeeLocations", method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<EmployeeLocationDetails>> getEmployeeLocations(
@RequestParam("employeeId") String empId) throws MyTimeException {
List<EmployeeLocationDetails> employeeLocationDetails = userService
.getEmployeeLocationDetails(empId);
return new ResponseEntity<>(employeeLocationDetails, HttpStatus.OK);
}
@RequestMapping(value = "/getManagers", method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<EmployeeRoles>> getManagers()
......@@ -157,35 +167,41 @@ public class UserController {
@RequestMapping(value = "/getAccounts", method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<String>> getAccounts() throws MyTimeException {
List<String> technologies = userService.getAccounts().stream()
public ResponseEntity<List<Account>> getAccounts() throws MyTimeException {
List<Account> technologies = userService.getAccounts().stream()
.filter(e -> "Y".equalsIgnoreCase(e.getStatus()))
.map(Account::getAccountName).sorted()
// .map(Account::getAccountName).sorted()
.collect(Collectors.toList());
return new ResponseEntity<>(technologies, HttpStatus.OK);
}
@RequestMapping(value = "/getEmployeeRoleDataForSearchCriteria", method = RequestMethod.GET,
@RequestMapping(value = "/getEmployeeRoleDataForSearchCriteria",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<EmployeeRoles> getEmployeeRoleDataForSearchCriteria(
@RequestParam("searchId") String searchId, @RequestParam("searchAttribute") String searchAttribute) throws MyTimeException {
EmployeeRoles employeesRole = userService.getEmployeeRoleDataForSearchCriteria(searchId, searchAttribute);
@RequestParam("searchId") String searchId,
@RequestParam("searchAttribute") String searchAttribute)
throws MyTimeException {
EmployeeRoles employeesRole = userService
.getEmployeeRoleDataForSearchCriteria(searchId,
searchAttribute);
return new ResponseEntity<>(employeesRole, HttpStatus.OK);
}
@RequestMapping(value = "/getEmployeeDetailsForAutocomplete", method = RequestMethod.GET,
@RequestMapping(value = "/getEmployeeDetailsForAutocomplete",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<String>> getEmployeeDetailsForAutocomplete() throws MyTimeException {
public ResponseEntity<List<String>> getEmployeeDetailsForAutocomplete()
throws MyTimeException {
List<String> details = userService.getEmployeeDetailsForAutocomplete();
return new ResponseEntity<>(details, HttpStatus.OK);
}
@RequestMapping(value = "/getMasterData", method = RequestMethod.GET,
@RequestMapping(value = "/getMasterData", method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Map<String, List<String>>> getMasterData()
throws MyTimeException {
Map<String, List<String>> masterDataMap = new HashMap<>();
Map<String, List<String>> masterDataMap = new HashMap<>();
Map<String, List<MasterData>> result = userService.getMasterData()
.stream().filter(e -> (e.isActiveStatus() == true))
.collect(Collectors.groupingBy(MasterData::getMasterDataType));
......
package com.nisum.mytime.model;
import java.io.Serializable;
import java.util.List;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
......@@ -20,13 +21,15 @@ import lombok.ToString;
@Document(collection = "Accounts")
public class Account implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
@Id
private ObjectId id;
private String accountId;
private String accountName;
private int accountProjectSequence;
@Id
private ObjectId id;
private String accountId;
private String accountName;
private int accountProjectSequence;
private String status;
private String domain;
List<String> subDomains;
}
......@@ -23,12 +23,17 @@ import lombok.ToString;
@Document(collection = "BillingDetails")
public class BillingDetails implements Serializable {
public Date getBillingEndDate() {
return billingEndDate;
}
private static final long serialVersionUID = 1L;
@Id
private ObjectId id;
private String employeeId;
private String employeeName;
private String account;
private String projectId;
private String projectName;
private String billableStatus;
......@@ -38,7 +43,7 @@ public class BillingDetails implements Serializable {
private Date billingEndDate;
private String comments;
private boolean active;
@DateTimeFormat(iso = ISO.DATE)
@DateTimeFormat(pattern = "dd-MM-yyyy")
private Date createDate;
}
package com.nisum.mytime.model;
import java.io.Serializable;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class ColumnChartData implements Serializable {
private String categories; // GAP
private String seriesName; // Billable
private long count; // count
private List categoriesList;
private List seriesDataList;
private String billableStatus;
}
\ No newline at end of file
package com.nisum.mytime.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import com.poiji.annotation.ExcelCellName;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "EmployeeLocationDetails")
public class EmployeeLocationDetails implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private ObjectId id;
private String employeeId;
private String employeeName;
private String empLocation;
private Date startDate;
private Date endDate;
private Date createDate;
private Date updatedDate;
private boolean active;
}
......@@ -5,8 +5,6 @@ import java.util.Date;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
import com.poiji.annotation.ExcelCellName;
......@@ -78,16 +76,26 @@ public class EmployeeRoles implements Serializable {
private String employmentType;
@ExcelCellName("Date Of Joining")
@DateTimeFormat(iso = ISO.DATE)
private Date dateOfJoining;
@ExcelCellName("Date Of Birth")
@DateTimeFormat(iso = ISO.DATE)
private Date dateOfBirth;
@ExcelCellName("Gender")
private String gender;
@ExcelCellName("Has Passport")
private String hasPassort;
@ExcelCellName("Passport Expiry Date")
private Date passportExpiryDate;
@ExcelCellName("Has B1")
private String hasB1;
@ExcelCellName("B1 Expiry Date")
private Date B1ExpiryDate;
@ExcelCellName("Created")
private Date createdOn;
......
package com.nisum.mytime.model;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class GroupByCount implements Serializable {
private String name;
private long y;
}
\ No newline at end of file
......@@ -30,6 +30,7 @@ public class Project implements Serializable {
private String managerId;
private String managerName;
private String account;
private String domain;
private String status;
private List<String> employeeIds;
......
package com.nisum.mytime.model;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class ReportSeriesRecord implements Serializable {
private String name;
private long[] data;
}
\ No newline at end of file
package com.nisum.mytime.repository;
import java.util.List;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.EmployeeLocationDetails;
public interface EmployeeLocationDetailsRepo extends MongoRepository<EmployeeLocationDetails, String> {
List<EmployeeLocationDetails> findByEmployeeId(String employeeId);
EmployeeLocationDetails findByEmployeeName(String employeeName);
}
......@@ -7,18 +7,27 @@ import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.ProjectTeamMate;
public interface ProjectTeamMatesRepo extends MongoRepository<ProjectTeamMate, String> {
public interface ProjectTeamMatesRepo
extends MongoRepository<ProjectTeamMate, String> {
List<ProjectTeamMate> findByProjectId(String projectId);
List<ProjectTeamMate> findByProjectId(String projectId);
List<ProjectTeamMate> findByManagerId(String projectId);
List<ProjectTeamMate> findByManagerId(String projectId);
List<ProjectTeamMate> findByEmployeeId(String employeeId);
ProjectTeamMate findById(ObjectId id);
List<ProjectTeamMate> findByEmployeeId(String employeeId);
ProjectTeamMate findByEmployeeIdAndManagerId(String employeeId, String managerId);
ProjectTeamMate findByEmployeeIdAndProjectId(String employeeId, String projectId);
ProjectTeamMate findById(ObjectId id);
ProjectTeamMate findByEmployeeIdAndManagerId(String employeeId,
String managerId);
ProjectTeamMate findByEmployeeIdAndProjectId(String employeeId,
String projectId);
List<ProjectTeamMate> findByEmployeeIdAndActive(String employeeId,
boolean status);
List<ProjectTeamMate> findByEmployeeIdAndProjectIdAndActive(
String employeeId, String projectId, boolean status);
}
package com.nisum.mytime.service;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
......@@ -8,6 +9,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang.time.DateUtils;
import org.bson.types.ObjectId;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -139,9 +141,9 @@ public class ProjectServiceImpl implements ProjectService {
List<BillingDetails> listBD = getEmployeeActiveNisumBench(
pT.getEmployeeId());
for (BillingDetails b : listBD) {
Date d = new Date();
Date d = pT.getStartDate() != null ? pT.getStartDate() : new Date();
d.setDate(d.getDate() - 1);
b.setBillingEndDate(d);
b.setBillingEndDate(DateUtils.truncate(d, Calendar.DATE));
b.setActive(false);
updateEmployeeBilling(b);
}
......@@ -151,12 +153,27 @@ public class ProjectServiceImpl implements ProjectService {
billings.setProjectId(pT.getProjectId());
billings.setProjectName(pT.getProjectName());
billings.setBillableStatus(pT.getBillableStatus());
billings.setAccount(pT.getAccount());
billings.setActive(true);
billings.setBillingStartDate(pT.getStartDate());
billings.setBillingEndDate(pT.getEndDate());
billings.setBillingStartDate(
DateUtils.truncate(pT.getStartDate(), Calendar.DATE));
billings.setBillingEndDate(
DateUtils.truncate(pT.getEndDate(), Calendar.DATE));
billings.setCreateDate(new Date());
addEmployeeBillingDetails(billings);
if (projectTeamMate.getProjectId() != null && !projectTeamMate
.getProjectId().equalsIgnoreCase("Nisum0000")) {
List<ProjectTeamMate> activeBenchProject = projectTeamMatesRepo
.findByEmployeeIdAndProjectIdAndActive(
projectTeamMate.getEmployeeId(), "Nisum0000", true);
if (activeBenchProject != null || activeBenchProject.size() != 0) {
for (ProjectTeamMate pteamMate : activeBenchProject) {
pteamMate.setActive(false);
projectTeamMatesRepo.save(pteamMate);
}
}
}
return pT;
}
......@@ -181,7 +198,8 @@ public class ProjectServiceImpl implements ProjectService {
BillingDetails billingDetails = listBD.get(0);
Date d = new Date();
d.setDate(d.getDate() - 1);
billingDetails.setBillingEndDate(d);
billingDetails.setBillingEndDate(
DateUtils.truncate(d, Calendar.DATE));
billingDetails.setActive(false);
updateEmployeeBilling(billingDetails);
}
......@@ -189,11 +207,14 @@ public class ProjectServiceImpl implements ProjectService {
billings.setEmployeeId(projectTeamMate.getEmployeeId());
billings.setEmployeeName(projectTeamMate.getEmployeeName());
billings.setProjectId(projectTeamMate.getProjectId());
billings.setAccount(existingTeammate.getAccount());
billings.setProjectName(projectTeamMate.getProjectName());
billings.setBillableStatus(projectTeamMate.getBillableStatus());
billings.setActive(true);
billings.setBillingStartDate(new Date());
billings.setBillingEndDate(projectTeamMate.getEndDate());
billings.setBillingStartDate(
DateUtils.truncate(new Date(), Calendar.DATE));
billings.setBillingEndDate(DateUtils
.truncate(projectTeamMate.getEndDate(), Calendar.DATE));
billings.setCreateDate(new Date());
addEmployeeBillingDetails(billings);
// TODO
......@@ -214,28 +235,61 @@ public class ProjectServiceImpl implements ProjectService {
public void deleteTeammate(String empId, String projectId, ObjectId id) {
ProjectTeamMate existingTeammate = projectTeamMatesRepo.findById(id);
existingTeammate.setActive(false);
existingTeammate.setEndDate(new Date());
BillingDetails billingDetails = new BillingDetails();
billingDetails.setBillableStatus("Bench");
billingDetails.setBillingStartDate(new Date());
billingDetails.setActive(true);
billingDetails.setEmployeeId(existingTeammate.getEmployeeId());
billingDetails.setEmployeeName(existingTeammate.getEmployeeName());
billingDetails.setCreateDate(new Date());
billingDetails.setProjectId("Nisum0000");
billingDetails.setProjectName("Free Pool");
addEmployeeBillingDetails(billingDetails);
Calendar c = Calendar.getInstance();
c.add(Calendar.DAY_OF_MONTH, -1);
existingTeammate.setEndDate(c.getTime());
/*
* BillingDetails billingDetails = new BillingDetails();
* billingDetails.setBillableStatus("Bench");
* billingDetails.setBillingStartDate(new Date());
* billingDetails.setActive(true);
* billingDetails.setEmployeeId(existingTeammate.getEmployeeId());
* billingDetails.setEmployeeName(existingTeammate.getEmployeeName());
* billingDetails.setCreateDate(new Date());
* billingDetails.setProjectId("Nisum0000");
* billingDetails.setProjectName("Free Pool");
* addEmployeeBillingDetails(billingDetails);
*/
List<BillingDetails> listBD = getEmployeeActiveBillingDetails(empId,
projectId);
if (listBD != null && !listBD.isEmpty()) {
BillingDetails billingDetailsExisting = listBD.get(0);
Date d = new Date();
d.setDate(d.getDate() - 1);
billingDetailsExisting.setBillingEndDate(d);
billingDetailsExisting
.setBillingEndDate(DateUtils.truncate(d, Calendar.DATE));
billingDetailsExisting.setActive(false);
updateEmployeeBilling(billingDetailsExisting);
}
projectTeamMatesRepo.save(existingTeammate);
List<ProjectTeamMate> activeProjects = projectTeamMatesRepo
.findByEmployeeIdAndActive(existingTeammate.getEmployeeId(),
true);
if (activeProjects == null || activeProjects.size() == 0) {
ProjectTeamMate newBenchAllocation = new ProjectTeamMate();
newBenchAllocation.setAccount("Nisum");
newBenchAllocation.setBillableStatus("Non-Billable");
newBenchAllocation
.setDesignation(existingTeammate.getDesignation());
newBenchAllocation.setEmailId(existingTeammate.getEmailId());
newBenchAllocation.setEmployeeId(existingTeammate.getEmployeeId());
newBenchAllocation
.setEmployeeName(existingTeammate.getEmployeeName());
newBenchAllocation.setProjectId("Nisum0000");
newBenchAllocation.setStartDate(new Date());
Project p = projectRepo.findByProjectId("Nisum0000");
newBenchAllocation.setProjectName(p.getProjectName());
newBenchAllocation.setManagerId(p.getManagerId());
newBenchAllocation.setManagerName(p.getManagerName());
try {
addProjectTeamMate(newBenchAllocation);
} catch (MyTimeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
@Override
......@@ -422,12 +476,13 @@ public class ProjectServiceImpl implements ProjectService {
@Override
public BillingDetails addEmployeeBillingDetails(BillingDetails teamMate) {
List<BillingDetails> billingsPast = getEmployeeBillingDetails(
teamMate.getEmployeeId(), teamMate.getProjectId());
/*
* for (BillingDetails tB : billingsPast) { tB.setActive(false);
* teamMatesBillingRepo.save(tB); }
*/
* List<BillingDetails> billingsPast = getEmployeeBillingDetails(
* teamMate.getEmployeeId(), teamMate.getProjectId());
*/ /*
* for (BillingDetails tB : billingsPast) { tB.setActive(false);
* teamMatesBillingRepo.save(tB); }
*/
teamMate.setCreateDate(new Date());
return teamMatesBillingRepo.save(teamMate);
}
......
......@@ -6,6 +6,7 @@ import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Account;
import com.nisum.mytime.model.Designation;
import com.nisum.mytime.model.EmpLoginData;
import com.nisum.mytime.model.EmployeeLocationDetails;
import com.nisum.mytime.model.EmployeeRoles;
import com.nisum.mytime.model.Location;
import com.nisum.mytime.model.MasterData;
......@@ -34,8 +35,15 @@ public interface UserService {
EmployeeRoles updateEmployeeRole(EmployeeRoles employeeRoles);
void updateEmployeeLocationDetails(EmployeeRoles employeeRoles,
boolean delete);
void saveEmployeeLocationDetails(EmployeeRoles employeeRoles);
EmployeeRoles getEmployeesRoleData(String empId);
List<EmployeeLocationDetails> getEmployeeLocationDetails(String empId);
List<Shift> getAllShifts() throws MyTimeException;
List<Designation> getAllDesignations() throws MyTimeException;
......@@ -49,10 +57,10 @@ public interface UserService {
List<Location> getLocations() throws MyTimeException;
EmployeeRoles getEmployeeRoleDataForSearchCriteria(String searchId,
String searchAttribute);
EmployeeRoles getEmployeeRoleDataForSearchCriteria(String searchId, String searchAttribute);
List<String> getEmployeeDetailsForAutocomplete();
List<String> getEmployeeDetailsForAutocomplete();
List<MasterData> getMasterData() throws MyTimeException;
}
......@@ -19,6 +19,7 @@ import com.nisum.mytime.repository.TravelRepo;
import com.nisum.mytime.repository.VisaRepo;
import com.poiji.bind.Poiji;
import com.poiji.exception.PoijiExcelType;
import com.poiji.option.PoijiOptions;
import lombok.extern.slf4j.Slf4j;
......@@ -92,11 +93,16 @@ public class VisaServiceImpl implements VisaService {
String result = "Failure";
int counter = 0;
try {
PoijiOptions options = PoijiOptions.PoijiOptionsBuilder.settings()
.preferNullOverDefault(true).datePattern("dd-MMM-yyyy")
.build();
List<EmployeeRoles> employees = Poiji.fromExcel(
file.getInputStream(), PoijiExcelType.XLS,
EmployeeRoles.class);
EmployeeRoles.class, options);
if (!employees.isEmpty()) {
for (EmployeeRoles employee : employees) {
System.out.println("test employee" + employee);
if (null != employee.getEmployeeId())
findAndModifyEmployeeRole(employee);
else
......@@ -151,6 +157,7 @@ public class VisaServiceImpl implements VisaService {
* log.info("Inserted Employee record with Id: {}",
* employee.getEmployeeId());
*/
employee.setRole("Employee");
EmployeeRoles emp = userService
.getEmployeesRoleData(employee.getEmployeeId());
if (emp == null) {
......
......@@ -79,6 +79,23 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.refreshPageOrg = function(){
$scope.getOrgEmps();
}
var gridOptionsReport = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
enableFiltering: true,
columnDefs : [
{field : 'employeeId',displayName: 'Employee ID', enableColumnMenu: true, enableSorting: true,enableFiltering: true, width:120},
{field : 'employeeName',displayName: 'Name', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'mobileNumber',displayName: 'Mobile', enableColumnMenu: false, enableSorting: false,enableFiltering: false},
{field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'baseTechnology',displayName: 'Skill', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'designation',displayName: 'Designation', enableColumnMenu: false, enableSorting: true,enableFiltering: true},
{field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: true,enableFiltering: true, width:100},
{name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false,enableFiltering: false, width:100}
]
};
$scope.getUserRoles = function(){
$http({
method : "GET",
......@@ -90,6 +107,19 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.gridOptions.data = [];
});
};
$scope.getReportData = function(){
$http({
method : "GET",
url : appConfig.appUri + "reports/functioNalGroup"
}).then(function mySuccess(response) {
$scope.reportData= response.data;
alert("reportData"+reportData)
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
alert("reportData1"+reportData)
$scope.reportData = [];
});
};
$scope.getOrgEmps = function(){
$http({
method : "GET",
......
myApp.directive('hcPieChart', function () {
return {
restrict: 'E',
template: '<div></div>',
link: function (scope, element) {
getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByMonth','line',element,"Employees By Functional Group");
scope.clickMe= function() {
// if(scope.reportId == 1234){
// scope.result = [{data:[{name:"ES", y:279},{name: "SAMP", y: 2},{name: "APPS", y: 1}]}]
// scope.drawChart(element,'column');
// }
if(scope.reportId == 123){
getEmployeeDetails(scope,element[0].baseURI+'reports/getEmployeesByFunctionalGroup','pie',element,"Employees By Functional Group");
}else {
getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByMonth','line',element," Billability Monthly Trends");
}
}
}
};
}).controller('chartsController', function ($scope, $http, myFactory, $mdDialog, appConfig) {
$scope.name = [];
$scope.records = [];
$scope.empSearchId = "";
//$scope.reports = $scope.reportId;
$scope.reports=[ {Name:"Employee Overview Report",Id:"1234"},{Name:"Employees By Functional Group",Id:"123"},{Name:"Billability Monthly Trends",Id:"12345"}];
$scope.parentData = {
"employeeId": "",
"employeeName": "",
"emailId":"",
"role": "",
"shift": "",
"projectId":"",
"projectName":"",
"managerId":"",
"managerName":"",
"experience":"",
"designation":"",
"action":""
};
$scope.employees = [];
$scope.projects = [];
var getCellTemplate = '<p class="col-lg-12"><i class="fa fa-pencil-square-o fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Update\')"></i>'+
'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>';
$scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
columnDefs : [
{field : 'employeeId',displayName: 'Employee ID', enableColumnMenu: true, enableSorting: true, width:120},
{field : 'employeeName',displayName: 'Name', enableColumnMenu: false, enableSorting: false},
{field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false},
{field : 'projectName',displayName: 'Project', enableColumnMenu: false, enableSorting: false},
{field : 'mobileNumber',displayName: 'Mobile No', enableColumnMenu: false, enableSorting: false}
]
};
$scope.gridOptions.data = $scope.records;
$scope.getRowData = function(row, action){
$scope.parentData.employeeId = row.entity.employeeId;
$scope.parentData.employeeName = row.entity.employeeName;
$scope.parentData.emailId = row.entity.emailId;
$scope.parentData.role = row.entity.role;
$scope.parentData.shift = row.entity.shift;
$scope.parentData.projectId = row.entity.projectId;
$scope.parentData.projectName = row.entity.projectName;
$scope.parentData.managerId = row.entity.managerId;
$scope.parentData.managerName = row.entity.managerName;
$scope.parentData.experience = row.entity.experience;
$scope.parentData.designation = row.entity.designation;
}
$scope.getMyTeamDetails = function(empid){
$http({
method : "GET",
url : appConfig.appUri + "/projectTeam/getMyTeamDetails?employeeId="+empid
}).then(function mySuccess(response) {
$scope.gridOptions.data = response.data;
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = [];
});
};
$scope.drawChart = function(element,chartName,result,title){
Highcharts.chart(element[0], {
chart: {
type: chartName
},
title: {
text: title
},
xAxis: {
categories: ['Plan', 'Retail', 'Buy', 'Sell'],
labels:{
formatter: function() {
if (chartName != 'pie' || chartName != 'line') {
return this.value;
} else{
return '(Not Designated)';
}
}
},
},
legend: {
align: 'right',
x: -30,
verticalAlign: 'top',
y: 25,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
borderColor: '#CCC',
borderWidth: 1,
shadow: false
},
tooltip: {
headerFormat: '<b>{point.x}</b><br/>',
pointFormat: '{series.name}: {point.y}'
},
plotOptions: {
series:{
events:{
click: function(event) {
$scope.custom(event);
}
}
}
},
series: result
});
}
$scope.custom = function(category){
alert('custome method')
$scope.getMyTeamDetails('16207');
}
});
function getEmployeeDetails(scope,uri,chart,element,title){
var result = [];
Highcharts.ajax({
url: uri,
success: function(data) {
if(chart=='line'){
result = data.seriesDataList;
scope.drawChart(element,chart,result,title);
}else if(chart == 'pie'){
result = data;
scope.drawChart(element,chart,result,title);
}
}
});
}
\ No newline at end of file
......@@ -151,6 +151,15 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
$scope.showOrHidePA="Show";
}
};
$scope.toggleEmpLocationDetails = function() {
$scope.showEmplocations = !$scope.showEmplocations;
if($scope.showOrHidePA=="Show"){
$scope.showOrHidePA="Hide";
}else {
$scope.showOrHidePA="Show";
}
};
$scope.toggleVisaDisplay = function() {
$scope.showVisaDisplay= !$scope.showVisaDisplay;
if($scope.showOrHidePV=="Show"){
......@@ -167,32 +176,51 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
pageNumber: 1,
pageSize:10,
columnDefs : [
{field : 'projectName',displayName: 'Project', enableColumnMenu: true, enableSorting: true},
{field : 'account',displayName: 'Account', enableColumnMenu: false, enableSorting: false},
{field : 'managerName',displayName: 'Manager Name', enableColumnMenu: false, enableSorting: false},
{field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false, enableSorting: false},
{field : 'startDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"'},
{field : 'endDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"' },
{field : 'active',displayName: 'Active', enableColumnMenu: false,cellTemplate:getCellActiveTemplate,enableSorting: false}
{field : 'projectName',displayName: 'Project', enableColumnMenu: true, enableSorting: true,minWidth : 100,width: 150},
{field : 'account',displayName: 'Account', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'managerName',displayName: 'Manager Name', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'startDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150},
{field : 'endDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"' ,minWidth : 100,width: 150},
{field : 'active',displayName: 'Active', enableColumnMenu: false,cellTemplate:getCellActiveTemplate,enableSorting: false,minWidth : 100,width: 150}
]
};
$scope.gridOptionsEmpLocationDetails = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
columnDefs : [
{field : 'employeeName',displayName: 'Employee Name', enableColumnMenu: true, enableSorting: true,minWidth : 100,width: 150},
{field : 'employeeId',displayName: 'EmployeeId', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'empLocation',displayName: 'Location', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'startDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"', minWidth : 100,width: 150 },
{field : 'endDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150 },
{field : 'updatedDate',displayName: 'Updated Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"' ,minWidth : 100,width: 150},
{field : 'createDate',displayName: 'Create Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"' ,minWidth : 100,width: 150},
{field : 'active',displayName: 'Active', enableColumnMenu: false,cellTemplate:getCellActiveTemplate,enableSorting: false,minWidth : 100,width: 150}
]
};
$scope.gridOptionsVisaDetails = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
columnDefs : [
{field : 'visa',displayName: 'Visa', enableColumnMenu: true, enableSorting: true},
{field : 'country',displayName: 'Country', enableColumnMenu: false, enableSorting: false},
{field : 'visaNo',displayName: 'Visa No', enableColumnMenu: false, enableSorting: false},
{field : 'visaStatus',displayName: 'Status', enableColumnMenu: false, enableSorting: false},
{field : 'visa',displayName: 'Visa', enableColumnMenu: true, enableSorting: true,minWidth : 100,width: 150},
{field : 'country',displayName: 'Country', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'visaNo',displayName: 'Visa No', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'visaStatus',displayName: 'Status', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field: 'visaExpiryDate',
displayName: 'Expiry Date',
cellFilter: 'date:"dd-MMM-yyyy"'
cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150
},
{field : 'comments',displayName: 'Comments', enableColumnMenu: false, enableSorting: false}
{field : 'comments',displayName: 'Comments', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150}
]
};
var getCellActiveTemplateBilling='<div ng-show="COL_FIELD==true"><p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>';
$scope.gridOptionsEmpBillability= {
......@@ -202,19 +230,18 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
pageSize:10,
enableCellEditOnFocus: true,
columnDefs : [
{field : 'projectName',displayName: 'Project', enableColumnMenu: true, enableSorting: true},
{field : 'account',displayName: 'Account', enableColumnMenu: false, enableSorting: false},
{field: 'billingStartDate',
displayName: 'Start Date',
cellFilter: 'date:"dd-MMM-yyyy"'
{field : 'projectName',displayName: 'Project', enableColumnMenu: true, enableSorting: true,minWidth : 100,width: 150},
{field : 'account',displayName: 'Account', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field: 'billingStartDate',displayName: 'Start Date',
cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150
},
{
field: 'billingEndDate',
displayName: 'End Date',
cellFilter: 'date:"dd-MMM-yyyy"'
cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150
},
{field : 'comments',displayName: 'Comments', enableColumnMenu: false, enableSorting: false},
{field : 'active',displayName: 'Active',enableColumnMenu: false, enableSorting: false,cellTemplate:getCellActiveTemplateBilling,enableCellEdit: false}
{field : 'comments',displayName: 'Comments', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'active',displayName: 'Active',enableColumnMenu: false, enableSorting: false,cellTemplate:getCellActiveTemplateBilling,enableCellEdit: false,minWidth : 100,width: 150}
]
};
......@@ -238,6 +265,16 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
});
$http({
method : "GET",
url : appConfig.appUri + "user/getEmployeeLocations?employeeId="+$scope.profile.employeeId
}).then(function mySuccess(response) {
//alert("response"+response);
// alert("response"+response.data);
$scope.gridOptionsEmpLocationDetails.data = response.data;
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
});
//$scope.gridOptionsProjectAllocatons.data = $scope.dataToPass;
//$scope.gridOptionsEmpBillability.data = $scope.dataToPass;
// $scope.gridOptionsVisaDetails.data = $scope.dataToPass;
......
......@@ -294,6 +294,8 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
menuItems.push({"menu" : "Attendance Report","icon" : "fa fa-bar-chart fa-2x","path" : "templates/attendanceReport.html"});
menuItems.push({"menu" : "Shift Details","icon" : "fa fa-superpowers fa-2x","path" : "templates/shiftdetails.html"});
menuItems.push({"menu" : "Dashboard","icon" : "fa fa-television fa-2x","path" : "templates/dashboard.html"});
menuItems.push({"menu" : "Charts","icon" : "fa fa-television fa-2x","path" : "templates/charts.html"});
menuItems.push({"menu" : "Utilization Report","icon" : "fa fa-television fa-2x","path" : "templates/charts3.html"});
menuItems.push({"menu" : "My Project Allocations","icon" : "fa fa-life-ring fa-2x","path" : "templates/myProjectAllocations.html"});
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"});
......
......@@ -66,7 +66,7 @@ myApp.controller("profileController", function($scope, $http, myFactory, $mdDial
$scope.validateFields = function(){
var mobileNumber = $scope.mobileNumber;
$scope.alertMsg = "";
var record = {"employeeId":myFactory.getEmpId(),"designation": $scope.designationEmp, "mobileNumber": mobileNumber, "alternateMobileNumber": $scope.alternateMobileNumber, "personalEmailId": $scope.personalEmailId, "baseTechnology": $scope.baseTechnology, "technologyKnown": $scope.technologyKnown};
var record = {"employeeId":myFactory.getEmpId(), "mobileNumber": mobileNumber, "alternateMobileNumber": $scope.alternateMobileNumber, "personalEmailId": $scope.personalEmailId, "baseTechnology": $scope.baseTechnology, "technologyKnown": $scope.technologyKnown};
var urlRequest = "";
urlRequest = appConfig.appUri+ "user/updateProfile";
......
......@@ -41,11 +41,12 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
$scope.parentData.account = row.entity.account;
$scope.parentData.managerId = row.entity.managerId;
$scope.parentData.managerName = row.entity.managerName;
$scope.parentData.domain= row.entity.domain;
$scope.parentData.status = row.entity.status;
if(action == "Update")
$scope.addProject(action, $scope.parentData);
else if(action == "Delete")
$scope.deleteRole(row);
$scope.deleteRole(row);
else if(action == "View")
$scope.viewTeamDetails(action, $scope.parentData);
}
......@@ -267,7 +268,14 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
$scope.projectName = dataToPass.projectName;
$scope.managerId = dataToPass.managerId;
$scope.managerName = dataToPass.managerName;
$scope.account = dataToPass.account;
var accounts1=myFactory.getAccounts();
for (var i = 0; i < accounts1.length; i++) {
if (accounts1[i].accountName=dataToPass.account) {
$scope.account = accounts1[i];
}
}
$scope.domain = dataToPass.domain;
$scope.projectStatus = dataToPass.status;
$scope.managerModel = {
'employeeName': dataToPass.managerName,
......@@ -416,12 +424,18 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
$scope.getAccountText = function(){
if ($scope.account !== undefined) {
return $scope.account;
return $scope.account.accountName;
} else {
return "Please select account";
}
};
$scope.getDomainText = function(){
if ($scope.domain !== undefined) {
return $scope.domain;
} else {
return "Please select domain";
}
};
$scope.validateEmpId = function(){
var searchId = $scope.empId;
if(searchId != "" && isNaN(searchId)){
......@@ -489,12 +503,16 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
}else if(account == undefined || account == ""){
$scope.alertMsg = "Account is mandatory";
document.getElementById('account').focus();
}
}else if(domain == undefined || domain == ""){
$scope.alertMsg = "Domain is mandatory";
document.getElementById('domain').focus();
}
else if(managerModel == undefined){
$scope.alertMsg = "Please select a manager";
}else{
$scope.alertMsg = "";
var record = {"projectId":$scope.projectId, "projectName": $scope.projectName, "managerId": $scope.managerModel.employeeId, "managerName": $scope.managerModel.employeeName, "status": $scope.projectStatus,"account": $scope.account};
var record = {"projectId":$scope.projectId, "projectName": $scope.projectName, "managerId": $scope.managerModel.employeeId, "managerName": $scope.managerModel.employeeName, "status": $scope.projectStatus,"account": $scope.account.accountName,"domain": $scope.domain};
addOrUpdateProject(record, $scope.templateTitle);
$timeout(function(){updateGrid($scope.templateTitle, record)},500);
}
......
......@@ -569,7 +569,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
}
$scope.designations = myFactory.getDesignations();
$scope.billableStatuses = ["Billable","Shadow","Bench","Reserved","NA"];
$scope.billableStatuses = ["Billable","Shadow","Non-Billable","Reserved"];
$scope.shifts =myFactory.getShifts();
$scope.getSelectedDesignation = function(){
if ($scope.empDesignation !== undefined) {
......@@ -625,23 +625,43 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
$scope.alertMsg = "Please select a billable status";
document.getElementById('empBillableStatus').focus();
}else if($scope.startDate == undefined) {
$scope.alertMsg = "Please select StartDate";
$scope.alertMsg = "Please select Start Date";
document.getElementById('startDate').focus();
}else if($scope.endDate == undefined) {
$scope.alertMsg = "Please select EndDate";
$scope.alertMsg = "Please select End Date";
document.getElementById('endDate').focus();
}
else {
$scope.alertMsg = "";
var record = {"employeeId":employeeModel.employeeId, "employeeName":employeeModel.employeeName, "emailId": employeeModel.emailId, "role": employeeModel.role, "designation":employeeModel.designation,"shift": employeeModel.shift,"projectId":projectModel.projectId,"projectName":projectModel.projectName,"account":$scope.projectModel.account,"managerId":myFactory.getEmpId(),"managerName":myFactory.getEmpName(),"mobileNumber":employeeModel.mobileNumber,"active":true,"billableStatus":$scope.empBillableStatus,"startDate":$scope.startDate,"endDate":$scope.endDate};
addOrUpdateRole(record, $scope.templateTitle);
$timeout(function(){updateGrid($scope.templateTitle, record)},500);
}
}else{
}
else{
var projectModel = $scope.projectModel;
if(projectModel == undefined){
$scope.alertMsg = "Please select a project";
document.getElementById('selectProject').focus();
}else if($scope.empBillableStatus == undefined){
$scope.alertMsg = "Please select a billable status";
document.getElementById('empBillableStatus').focus();
}else if($scope.shift == undefined || $scope.shift =="") {
$scope.alertMsg = "Please select shift";
document.getElementById('shift').focus();
}else if($scope.startDate == undefined) {
$scope.alertMsg = "Please select Start Date";
document.getElementById('startDate').focus();
}else if($scope.endDate == undefined) {
$scope.alertMsg = "Please select End Date";
document.getElementById('endDate').focus();
}else{
$scope.alertMsg = "";
var record = {"id":$scope.id,"employeeId":$scope.employeeId, "employeeName":$scope.employeeName, "emailId": $scope.emailId, "role": $scope.role, "shift": $scope.shift,"projectId":$scope.projectModel.projectId,"projectName":$scope.projectModel.projectName,"account":$scope.projectModel.account,"managerId":myFactory.getEmpId(),"managerName":myFactory.getEmpName(),"designation":$scope.empDesignation,"billableStatus":$scope.empBillableStatus,"experience":$scope.experience,"mobileNumber":$scope.mobileNumber,"startDate":$scope.startDate,"endDate":$scope.endDate};
addOrUpdateRole(record, $scope.templateTitle);
$timeout(function(){updateGrid($scope.templateTitle, record)},500);
}
}
......
myApp.directive('highchartxyz', function () {
return {
restrict: 'E',
template: '<div></div>',
replace: true,
link: function (scope, element, attrs) {
scope.$watch(function () { return attrs.chart; }, function () {
if (!attrs.chart) return;
var charts = JSON.parse(attrs.chart);
$(element[0]).highcharts(charts);
});
}
};
});
myApp.controller('Ctrl', function ($scope, $http, $timeout,appConfig) {
$timeout($scope.fetch, 1000);
$scope.reports=["Employee Overview Report","Billability Report","Billability Monthly Trends"];
$scope.getReport = function(){
if ($scope.report !== undefined) {
return $scope.report;
} else {
return "Please select a report";
}
}
$scope.triggerRport1 = function(){
alert('series clicked');
}
$scope.triggerRport2 = function(){
alert('pie clicked');
}
function custom(){
alert('called');
}
$scope.customCall = function(){
alert('customCall called');
}
$scope.triggerRport = function(){
if($scope.report== 'Employee Overview Report'){
$http({
method : "GET",
url : appConfig.appUri + "reports/getEmployeesByFunctionalGroup1"
}).then(function mySuccess(response) {
$scope.options =response.data;
$scope.renderChart = {
chart: {
type: 'pie'
},
title: {
text:'test'
},
plotOptions: {
pie: {
// allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
},
events: {
click: function(event) {
custom();
}
}
},
series: {
cursor: 'pointer',
point: {
events: {
click: function() {
customCall();
}
}
}
}
},
series: [{
data: $scope.options
}]
};
}, function myError(response) {
});
}else if($scope.report== 'Billability Report'){
$http({
method : "GET",
url : appConfig.appUri + "reports/getBillabilityDetailsByAccount"
}).then(function mySuccess(response) {
$scope.options = response.data.seriesDataList;
/*[{
name: 'Billable',
data: [5, 3, 4, 7]
}, {
name: 'Shadow',
data: [2, 2, 3, 2]
}, {
name: 'Reserved',
data: [3, 4, 4, 2]
},
{
name: 'Bench',
data: [3, 4, 4, 2]
}
];*/
$scope.catagories=response.data.categoriesList; //['Gap', 'Macys', 'X', 'Y']
$scope.renderChart = {
chart: {
type: 'column'
},
title: {
text: 'Monthly Average Temperature'
},
xAxis: {
categories: $scope.catagories
},
yAxis: {
min: 0,
title: {
text: 'Total fruit consumption'
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
},
legend: {
align: 'right',
x: -30,
verticalAlign: 'top',
y: 25,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
borderColor: '#CCC',
borderWidth: 1,
shadow: false
},
tooltip: {
headerFormat: '<b>{point.x}</b><br/>',
pointFormat: '{series.name}: {point.y}<br/>Total: {point.stackTotal}'
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: true,
color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
}
},
series:{
cursor: 'pointer',
point: {
events: {
click: function () {
alert('Category: ' + this.category + ', value: ' + this.y);
}
}
}
}
},
series: $scope.options
};
}, function myError(response) {
});
} else if($scope.report== 'Billability Monthly Trends'){
$http({
method : "GET",
url : appConfig.appUri + "reports/getBillabilityDetailsByMonth"
}).then(function mySuccess(response) {
$scope.options = response.data.seriesDataList;
/*[{
name: 'Billable',
data: [5, 3, 4, 7]
}, {
name: 'Shadow',
data: [2, 2, 3, 2]
}, {
name: 'Reserved',
data: [3, 4, 4, 2]
},
{
name: 'Bench',
data: [3, 4, 4, 2]
}
];*/
$scope.catagories=response.data.categoriesList; //['Gap', 'Macys', 'X', 'Y']
$scope.renderChart = {
chart: {
type: 'line'
},
title: {
text: 'Monthly Average Temperature'
},
xAxis: {
categories: $scope.catagories
},
yAxis: {
min: 0,
title: {
text: 'Total fruit consumption'
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
},
legend: {
align: 'right',
x: -30,
verticalAlign: 'top',
y: 25,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
borderColor: '#CCC',
borderWidth: 1,
shadow: false
},
tooltip: {
headerFormat: '<b>{point.x}</b><br/>',
pointFormat: '{series.name}: {point.y}<br/>Total: {point.stackTotal}'
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: true,
color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
}
},
series:{
events:{
click: function(event) {
alert('test');
}
}
}
},
series: $scope.options
};
}, function myError(response) {
});
}
}
});
......@@ -357,7 +357,7 @@ myApp.controller("travelController",function($scope, myFactory, $mdDialog, $http
}else if(dataToPass.action == "ViewTeamDetail"){}else if(dataToPass.action == "ViewBillability"){}
$scope.designations = myFactory.getDesignations();
$scope.billableStatuses = ["Billable","Shadow","Bench","Reserved","NA"];
$scope.billableStatuses = ["Billable","Shadow","Non-Billable","Reserved"];
$scope.shifts =myFactory.getShifts();
$scope.getSelectedDesignation = function(){
if ($scope.empDesignation !== undefined) {
......
......@@ -328,7 +328,7 @@ myApp.controller("visaController",function($scope, myFactory, $mdDialog, $http,
}else if(dataToPass.action == "ViewTeamDetail"){}else if(dataToPass.action == "ViewBillability"){}
$scope.designations = myFactory.getDesignations();
$scope.billableStatuses = ["Billable","Shadow","Bench","Reserved","NA"];
$scope.billableStatuses = ["Billable","Shadow","Non-Billable","Reserved"];
$scope.shifts =myFactory.getShifts();
$scope.getSelectedDesignation = function(){
if ($scope.empDesignation !== undefined) {
......
<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>
</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 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>
</body>
</html>
\ No newline at end of file
<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
<div class="md-padding" style="width: 100%; padding: 3px 0px 0px 0px;"
id="popupContainer333" ng-controller="assignRoleController"
ng-init="getUserRoles()">
<button ng-click="getUserRoles()">click Me</button>
<md-button class="md-icon-button" ng-click="getUserRoles()"> <i
class="fa fa-times fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left">ReportData</i> </md-button>
<table>
<tr>
<td><div id="gridTest1" ui-grid="gridOptionsReport" ui-grid-pagination
class="" style="width:99%;height:370px;margin-left:0px;">
<div class="watermark" ng-show="!gridOptionsReport.data.length">No
data available</div>
</div></td>
</tr>
<tr>
<td><div id="container1Pie" style="width:99%;height:370px;margin-left:0px;min-width: 800px;
max-width: 800px;">
</div></td>
</tr>
</table>
</div>
<div class="md-padding" style="width: 100%; padding: 3px 0px 0px 0px;"
id="popupContainer333" ng-controller="assignRoleController"
ng-init="getUserRoles()">
<script type="text/javascript">
/* document.addEventListener('DOMContentLoaded', function () {
alert('called')
var options = {
chart: {
type: 'pie'
},
series: [{}]
};
Highcharts.ajax({
url: '/myTime/reports/functioNalGroup',
success: function(data) {
alert("fg data"+data)
options.series[0].data = data;
Highcharts.Chart('container1Pie', options);
}
});
}); */
var result;
function requestData() {
alert('requestData');
Highcharts.ajax({
url: '/myTime/reports/functioNalGroup',
success: function(data) {
alert("fg data"+data)
result = data;
alert('requestData result'+result);
}
});
/* $http({
method : "GET",
url : "/myTime/reports/functioNalGrou"
}).then(function mySuccess(response) {
result = response.data;
alert('requestData result'+result);
}, function myError(response) {
alert('requestData error');
result = [];
}); */
}
Highcharts.chart('container1Pie', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie',
},
title: {
text: 'Browser market shares in January, 2018'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
}
},
series: {
cursor: 'pointer',
point: {
events: {
click: function () {
alert('this.series.name'+this.series.name);
alert(' this.category111'+ this.options.name);
// tableFilter(this.series.name,this.category,this.y);
}
}
}
}
},
series: [{
name: 'Functional Group',
colorByPoint: true,
data: result
}]
});
var gridOptionsReport = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
enableFiltering: true,
columnDefs : [
{field : 'employeeId',displayName: 'Employee ID', enableColumnMenu: true, enableSorting: true,enableFiltering: true, width:120},
{field : 'employeeName',displayName: 'Name', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'mobileNumber',displayName: 'Mobile', enableColumnMenu: false, enableSorting: false,enableFiltering: false},
{field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'baseTechnology',displayName: 'Skill', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'designation',displayName: 'Designation', enableColumnMenu: false, enableSorting: true,enableFiltering: true},
{field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: true,enableFiltering: true, width:100},
{name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false,enableFiltering: false, width:100}
]
};
/* Highcharts.chart('companyfunctionalGroupReport', {
title: {
text: 'Solar Employment Growth by Sector, 2010-2016'
},
subtitle: {
text: 'Source: thesolarfoundation.com'
},
yAxis: {
title: {
text: 'Number of Employees'
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle'
},
plotOptions: {
series: {
label: {
connectorAllowed: false
},
pointStart: 2010
}
},
series: [{
name: 'Installation',
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
}, {
name: 'Manufacturing',
data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
}, {
name: 'Sales & Distribution',
data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
}, {
name: 'Project Development',
data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
}, {
name: 'Other',
data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
}],
responsive: {
rules: [{
condition: {
maxWidth: 500
},
chartOptions: {
legend: {
layout: 'horizontal',
align: 'center',
verticalAlign: 'bottom'
}
}
}]
}
}); */
</script><button ng-click="getUserRoles()">click Me</button>
<md-button class="md-icon-button" ng-click="getUserRoles()"> <i
class="fa fa-times fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left">ReportData</i> </md-button>
<table>
<tr>
<td><div id="gridTest1" ui-grid="gridOptionsReport" ui-grid-pagination
class="" style="width:99%;height:370px;margin-left:0px;">
<div class="watermark" ng-show="!gridOptionsReport.data.length">No
data available</div>
</div></td>
</tr>
<tr>
<td><div id="container1Pie" style="width:99%;height:370px;margin-left:0px;min-width: 800px;
max-width: 800px;">
</div></td>
</tr>
</table>
</div>
......@@ -212,7 +212,19 @@
</div>
</div>
<br/><br/>
</fieldset>
<fieldset>
<legend style="font-size: 18px;">Location Details <i style="margin-top:3px;color:blue;cursor:pointer;font-size: 14px;" ng-click="toggleEmpLocationDetails()">{{showOrHideBD}}</i></legend>
<div class="row col-lg-12" style="margin-left: 0px;">
<div id="gridEmpLocationDetails" ui-grid="gridOptionsEmpLocationDetails"
class="myGrid" style="width:99%;height:200px;" ng-show="showEmplocations">
<div class="watermark" ng-show="!gridOptionsEmpLocationDetails.data.length">No
data available</div>
</div>
</div>
<br/><br/>
</fieldset>
</div>
......
......@@ -18,6 +18,11 @@
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-aria.min.js"></script>
<script src="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-2.5.0.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/series-label.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/data.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css"></link>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"></link>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"></link>
......@@ -70,6 +75,8 @@
<script src="controllers/TravelController.js"></script>
<script src="controllers/SessionHandlerController.js"></script>
<script src="controllers/ExportDataController.js"></script>
<script src="controllers/ChartsController.js"></script>
<script src="controllers/TestController2.js"></script>
</head>
<body>
<ng-include src="'templates/login.html'" id="home"></ng-include>
......
......@@ -14,24 +14,61 @@
<md-dialog-content>
<div class="md-dialog-content">
<div class="form-group">
<input type="text" class="form-control" id="projectId" name="projectId"
ng-model="projectId" placeholder="Project Id Auto Generates" ng-blur="" ng-disabled="true"/> <br>
<input type="text" class="form-control" id="projectName" name="projectName"
ng-model="projectName" placeholder="Project Name" /><br>
<md-select ng-model="account" md-selected-text="getAccountText()" id="account">
<md-optgroup label="account"> <md-option ng-value="account"
ng-repeat="account in accounts">{{account}}</md-option> </md-optgroup> </md-select>
<md-select ng-model="managerModel" md-selected-text="getManagers()" >
<div class="row" >
<table width="450px">
<tr>
<td colspan="4">
<b >Project ID</b></td>
<td colspan="8"><input type="text" class="form-control" id="projectId" name="projectId"
ng-model="projectId" placeholder="Project Id Auto Generates" ng-blur="" ng-disabled="true"/>
</td>
<tr>
<td colspan="4">
<b >Project Name</b></td>
<td colspan="8"><input type="text" class="form-control" id="projectName" name="projectName"
ng-model="projectName" placeholder="Project Name"/>
</td>
</tr>
<tr>
<td colspan="4">
<b >Account</b></td>
<td colspan="8"><md-select ng-model="account" md-selected-text="getAccountText()" id="account">
<md-optgroup label="account"> <md-option ng-value="account1"
ng-repeat="account1 in accounts">{{account1.accountName}}</md-option> </md-optgroup> </md-select>
</td>
</tr>
<tr>
<td colspan="4">
<b >Domain</b></td>
<td colspan="8"><md-select ng-model="domain" md-selected-text="getDomainText()" id="domain">
<md-optgroup label="domain"> <md-option ng-value="domain"
ng-repeat="domain in account.subDomains">{{domain}}</md-option> </md-optgroup> </md-select>
</td>
</tr>
<tr>
<td colspan="4">
<b >Manager</b></td>
<td colspan="8"><md-select ng-model="managerModel" md-selected-text="getManagers()" >
<md-optgroup label="managers"> <md-option ng-value="manager"
ng-repeat="manager in managerDetails">{{manager.employeeName}}</md-option> </md-optgroup> </md-select>
<md-select ng-model="projectStatus" md-selected-text="getProjectStatus()" id="projectStatus">
</td>
</tr>
<tr>
<td colspan="4">
<b >Project Status</b></td>
<td colspan="8"><md-select ng-model="projectStatus" md-selected-text="getProjectStatus()" id="projectStatus">
<md-optgroup label="projectStatus"> <md-option ng-value="prjctSts"
ng-repeat="prjctSts in prjctStses">{{prjctSts}}</md-option> </md-optgroup> </md-select>
</td>
</tr>
</table>
<div role="alert">
<span class="error" style="color: red;">{{alertMsg}}</span>
</div>
</div>
</div>
</div>
</md-dialog-content>
<md-dialog-actions layout="row"> <md-button
......
<md-dialog aria-label="Role Template" style="width:700px;height:900px;">
<md-dialog aria-label="Role Template" style="width:700px;height:1200px;">
<form ng-cloak name="myForm">
<md-toolbar>
<div class="md-toolbar-tools"
......
......@@ -14,9 +14,7 @@
<div class="md-dialog-content">
<div class="form-group">
<md-select ng-model="designationEmp" md-selected-text="getDesignationText()" id="designationEmp" >
<md-optgroup label="designations"> <md-option ng-value="designation"
ng-repeat="designation in designations">{{designation}}</md-option> </md-optgroup> </md-select>
<input type="text" class="form-control" id="mobileNumber" name="mobileNumber"
ng-model="mobileNumber" placeholder="Mobile Number" alt="Mobile Number"/> <br>
<input type="text" class="form-control" id="alternateMobileNumber" name="alternateMobileNumber"
......
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_ID">
<display-name>mytime</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
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