Commit 236ee698 authored by Vijay Akula's avatar Vijay Akula

Resolved conflicts

parents 22239759 d7162062
......@@ -40,9 +40,10 @@ public class AccountController {
respDetails = new ResponseDetails(new Date(), AccountStatus.CREATE.getCode(), AccountStatus.CREATE.getMessage(),
"Account description", null, request.getContextPath(), "details", accountPersisted);
}
}else {
respDetails = new ResponseDetails(new Date(), AccountStatus.ALREADY_EXISTED.getCode(), AccountStatus.ALREADY_EXISTED.getMessage(),
"Choose the different account name", null, request.getRequestURI(), "details", account);
}
return new ResponseEntity<ResponseDetails>(respDetails, HttpStatus.OK);
}
......
package com.nisum.myteam.controller;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.nisum.myteam.exception.handler.MyTeamException;
import com.nisum.myteam.model.EmployeeEfforts;
import com.nisum.myteam.service.IEmployeeEffortsService;
@RestController
@RequestMapping("/employeeEfforts")
public class EmployeeEffortsController {
@Autowired
private IEmployeeEffortsService employeeEffortService;
@RequestMapping(value = "getWeeklyReport", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<EmployeeEfforts>> employeeLoginsBasedOnDate(
@RequestParam("fromDate") String fromDate, @RequestParam("toDate") String toDate) throws MyTeamException {
List<EmployeeEfforts> employeeEffortsList = new ArrayList<>();
try {
employeeEffortsList = employeeEffortService.getEmployeeEffortsReport(fromDate, toDate);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity<>(employeeEffortsList, HttpStatus.OK);
}
}
......@@ -52,7 +52,7 @@ public class ResourceAllocationController {
if (!resourceAllocService.isResourceAssignedToAnyProject(resourceAllocationReq)) {
ResourceAllocation resourcePersisted = resourceAllocService.addResourceAllocation(resourceAllocationReq, loginEmpId);
ResponseDetails createResponseDetails = new ResponseDetails(new Date(), 601, "Resource has been created",
ResponseDetails createResponseDetails = new ResponseDetails(new Date(), 800, "Resource has been created",
"Resource description", null, request.getContextPath(), "details", resourcePersisted);
return new ResponseEntity<ResponseDetails>(createResponseDetails, HttpStatus.OK);
......@@ -61,12 +61,12 @@ public class ResourceAllocationController {
}
}
ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, resourceAllocService.respMap.get("message").toString(),
ResponseDetails responseDetails = new ResponseDetails(new Date(), resourceAllocService.respMap.get("statusCode").toString(), resourceAllocService.respMap.get("message").toString(),
"Error message desc", null, request.getRequestURI(), "Resource details", resourceAllocationReq);
return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
}
ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide the valid Employee Id",
ResponseDetails responseDetails = new ResponseDetails(new Date(), 820, "Please provide the valid Employee Id",
"Employee Id is not valid", null, request.getRequestURI(), "Resource details", resourceAllocationReq);
return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
......@@ -85,11 +85,11 @@ public class ResourceAllocationController {
resourceAllocService.updateResource(resourceAllocationReq, loginEmpId);
}
ResponseDetails createResponseDetails = new ResponseDetails(new Date(), 601, resourceAllocService.respMap.get("message").toString(),
ResponseDetails createResponseDetails = new ResponseDetails(new Date(), resourceAllocService.respMap.get("statusCode").toString(), resourceAllocService.respMap.get("message").toString(),
"Resource description", null, request.getContextPath(), "Resource details", resourceAllocationReq);
return new ResponseEntity<ResponseDetails>(createResponseDetails, HttpStatus.OK);
}
ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide the valid Employee Id",
ResponseDetails responseDetails = new ResponseDetails(new Date(), 820, "Please provide the valid Employee Id",
"Employee Id is not valid", null, request.getRequestURI(), "Resource details", resourceAllocationReq);
return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
}
......
package com.nisum.myteam.model;
import java.io.Serializable;
import org.springframework.data.annotation.Id;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class EmployeeEfforts implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private String id;
private String employeeId;
private String employeeName;
private String totalHoursSpentInWeek;
private String projectName;
private String accountName;
private String functionalOrg;
}
......@@ -52,7 +52,7 @@ public class LeaveNotificationScheduler {
private IFunctionalGroupService functionalGroupService;
//@Scheduled(cron = "0 * * * * ?")
//@Scheduled(cron = "0 * * * * ?")
//@Scheduled(cron = "00 50 15 * * 1-5")
public void scheduleLeaveMailForShift1Empls() throws IOException, MessagingException, MyTeamException {
//Shift 1(9:00 AM - 6:00 PM)
......@@ -94,7 +94,7 @@ public class LeaveNotificationScheduler {
private void sendMailToAbsentees(String shift) throws IOException, MessagingException, MyTeamException {
Mail mail = new Mail();
mail.setFrom(environment.getProperty("email.leave.notification.from"));
mail.setSubject(environment.getProperty("email.leave.notification.subject"));
......@@ -111,30 +111,27 @@ public class LeaveNotificationScheduler {
List<AttendenceData> absentiesList = attendenceList.stream()
.filter(attendance -> attendance.getPresent().equalsIgnoreCase(MyTeamUtils.ABSENT)).collect(Collectors.toList());
for (AttendenceData absentee : absentiesList) {
//model.put("employeeName", );//mail.setModel(model);
employee = employeeService.getEmployeeById(absentee.getEmployeeId());
empSubStatus = employee.getEmpSubStatus();
if(empSubStatus==null)
empSubStatus="";
if (employee.getEmpStatus().equalsIgnoreCase(EmployeeStatus.ACTIVE.getStatus()) && !empSubStatus.equalsIgnoreCase(EmpSubStatus.LONG_LEAVE.getLeaveType()) &&
if (employee.getEmpStatus().equalsIgnoreCase(EmployeeStatus.ACTIVE.getStatus()) && ( !empSubStatus.equalsIgnoreCase(EmpSubStatus.LONG_LEAVE.getLeaveType()) &&
!empSubStatus.equalsIgnoreCase(EmpSubStatus.MATERNITY_LEAVE.getLeaveType()) &&
!empSubStatus.equalsIgnoreCase(EmpSubStatus.ONSITE_TRAVEL.getLeaveType())) {
!empSubStatus.equalsIgnoreCase(EmpSubStatus.ONSITE_TRAVEL.getLeaveType()))) {
logger.info("Mail Notification is sending to:" + absentee.getEmployeeName() + "::" + absentee.getEmailId());
//mail.setEmpName(absentee.getEmployeeName());
//mail.setTo(absentee.getEmailId());
mail.setEmpName("Vijay");
mail.setTo("vakula@nisum.com");
mail.setEmpName("Prayas");
mail.setTo("pjain@nisum.com");
functionalGroup = functionalGroupService.getFunctionalGroup(employee.getFunctionalGroup());
//mail.setCc(new String[]{functionalGroup.getGroupHeadEmailId()});
mail.setCc(new String[]{"mduppanapudi@nisum.com"});
mail.setCc(new String[]{"prayasjain21@gmail.com"});
mailService.sendLeaveNotification(mail);
}
......
package com.nisum.myteam.service;
import java.sql.SQLException;
import java.util.List;
import com.nisum.myteam.exception.handler.MyTeamException;
import com.nisum.myteam.model.EmployeeEfforts;
public interface IEmployeeEffortsService {
List<EmployeeEfforts> getEmployeeEffortsReport(String fromDate, String toDate) throws MyTeamException, SQLException;
}
......@@ -46,7 +46,6 @@ public interface IProjectService {
public List<HashMap<Object, Object>> deliveryLeadProjects(String empId) throws MyTeamException;
public Account getProjectAccount(String accountId);
public Account updateProjSeqinAccount(Account account) throws MyTeamException;
......@@ -57,7 +56,6 @@ public interface IProjectService {
public List<Project> getActiveProjects() throws MyTeamException;
public List<Project> getProjectsForDeliveryLead(String deliveryLeadId);
List<Resource> getResourcesUnderProject(String empId);
......
package com.nisum.myteam.service.impl;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Time;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.nisum.myteam.configuration.DbConnection;
import com.nisum.myteam.exception.handler.MyTeamException;
import com.nisum.myteam.model.EmployeeEfforts;
import com.nisum.myteam.service.IEmployeeEffortsService;
import com.nisum.myteam.utils.MyTeamLogger;
import com.nisum.myteam.utils.MyTeamUtils;
@Component
@Transactional
public class EmployeeEffortsService implements IEmployeeEffortsService {
@Autowired
DbConnection dbConnection;
@Override
public List<EmployeeEfforts> getEmployeeEffortsReport(String fromDate, String toDate)
throws MyTeamException, SQLException {
String query = null;
query = MyTeamUtils.EMPLOYEE_EFFORTS_QUERY + "'" + fromDate.replace("-", "/") + "'"
+ MyTeamUtils.EMPLOYEE_EFFORTS_QUERY1 + "'" + toDate.replace("-", "/") + "'"
+ MyTeamUtils.EMPLOYEE_EFFORTS_QUERY2;
List<EmployeeEfforts> listOfEmpEffortsData = getEmployeeEfforts(query);
return listOfEmpEffortsData;
}
private List<EmployeeEfforts> getEmployeeEfforts(String query) {
List<EmployeeEfforts> listOfEmpEffortsData = new ArrayList<>();
try (Connection connection = dbConnection.getDBConnection();
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(query.toString())) {
while (resultSet.next()) {
EmployeeEfforts employeeEfforts = new EmployeeEfforts();
employeeEfforts.setEmployeeId(resultSet.getString("EmployeeCode"));
employeeEfforts.setEmployeeName(resultSet.getString("FirstName"));
employeeEfforts.setTotalHoursSpentInWeek(resultSet.getString("TotalHoursInWeek") + ':' + resultSet.getString("TotalMinutesInWeek"));
listOfEmpEffortsData.add(employeeEfforts);
}
} catch (Exception e) {
e.printStackTrace();
MyTeamLogger.getInstance().error(e.getMessage());
}
return listOfEmpEffortsData;
}
}
......@@ -59,6 +59,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
isExists = true;
}
respMap.put("statusCode", 810);
respMap.put("message", "Resource Not Found");
return isExists;
}
......@@ -68,6 +69,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
if (resourceAlloc != null) {
ResourceAllocation resourcePers = resourceAllocationRepo.save(resourceAlloc);
respMap.put("statusCode", 801);
respMap.put("message", "resource has been updated");
respMap.put("resourceObj", resourcePers);
......@@ -104,12 +106,14 @@ public class ResourceAllocationService implements IResourceAllocationService {
if (!resourceAllocation.getBillingStartDate().after(project.getProjectStartDate())) {
log.info("Billing start date should be after Project start date");
respMap.put("statusCode", 811);
respMap.put("message", "Billing start date should be after Project start date");
isValid = false;
}
if (!resourceAllocation.getBillingStartDate().before(resourceAllocation.getBillingEndDate())) {
log.info("Billing start date should be before Billing End Date.");
respMap.put("statusCode", 812);
respMap.put("message", "Billing start date should be before Billing End Date.");
isValid = false;
}
......@@ -118,6 +122,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
if (!resourceAllocation.getBillingEndDate().before(project.getProjectEndDate())) {
log.info("Billing end date should be before Project End Date.");
respMap.put("statusCode", 813);
respMap.put("message", "Billing end date should be before Project End Date.");
isValid = false;
}
......@@ -138,6 +143,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
+ projectService.getProjectByProjectId(resource.getProjectId()).getProjectName()
+ " project should not be before Date of Joining ( " + empDoj + ").";
isValid = false;
respMap.put("statusCode", 814);
respMap.put("message", message);
}
return isValid;
......@@ -160,6 +166,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
+ projectService.getProjectByProjectId(resourceAllocPrev.getProjectId()).getProjectName()
+ " Project" + " from " + resourceAllocPrev.getBillingStartDate() + "to " + resourceAllocPrev.getBillingEndDate();
isAssigned = true;
respMap.put("statusCode", 815);
respMap.put("message", message);
}
return isAssigned;
......@@ -168,6 +175,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
public void updateResource(ResourceAllocation resourceAllocReq, String loginEmpId) throws MyTeamException {
ResourceAllocation resourceAllocationPers = resourceAllocationRepo.save(resourceAllocReq);
respMap.put("statusCode", 801;
respMap.put("message", "Resource updated successfully");
respMap.put("resourceObj", resourceAllocationPers);
......
......@@ -88,7 +88,17 @@ public class MyTeamUtils {
public final static String ABESENT_STATUS_QUERY1 =" and convert(varchar,tr.aDateTime, 111) <= ";
public final static String ABESENT_STATUS_QUERY2 =" and emp.EmployeeCode = ";
public final static String ABESENT_STATUS_QUERY3 =" group by convert(varchar,tr.aDateTime, 111), emp.EmployeeCode, emp.FirstName";
public final static String EMPLOYEE_EFFORTS_QUERY = "Select EmployeeCode, FirstName, SUM(MinutesInOffice)/60 TotalHoursInWeek ,"
+ "SUM(MinutesInOffice)%60 TotalMinutesInWeek FROM(select emp.EmployeeCode,emp.FirstName, "
+ "DATEDIFF(MINUTE, MIN(tr.aDateTime),MAX(tr.aDateTime)) MinutesInOffice "
+" from [Transactions] as tr,EmployeeMaster as emp "+
" where tr.EmployeemasterID=emp.EmployeeMasterID and convert(varchar,tr.aDateTime, 111) >=";
public final static String EMPLOYEE_EFFORTS_QUERY1 = " and convert(varchar,tr.aDateTime, 111) <=";
public final static String EMPLOYEE_EFFORTS_QUERY2 = " group by convert(varchar,tr.aDateTime, 111), emp.EmployeeCode, emp.FirstName)"
+"A Group by EmployeeCode, FirstName HAVING SUM(MinutesInOffice) >=3000";
public final static String UNION=" Union ";
//public final static String PRESENT_QUERY = "SELECT DISTINCT Emp.EmployeeCode, Emp.FirstName FROM Transactions AS Tr, EmployeeMaster AS Emp WHERE Tr.EmployeemasterID = Emp.EmployeeMasterID AND CONVERT(VARCHAR,Tr.aDateTime, 111) = '<REPORTDATE>' AND Emp.EmployeeCode IN (<EMPIDS>)";
......
......@@ -59,7 +59,7 @@ email.leave.notification.subject=Employee Leave Email Notification
#spring.thymeleaf.suffix=/WEB-INF/thymeleaf/templates/
#spring.thymeleaf.prefix=.html
#spring.thymeleaf.view-names:thymeleaf/*
#spring.thymeleaf.view-names:thymeleaf/*
spring.thymeleaf.view-names:thymeleaf/*
email.project.notification.template.file.path=email/projectMailTemplate.html
......
......@@ -31,7 +31,7 @@
</tr>
<tr>
<td style="line-height: 25px; padding: 15px 20px 20px 20px"><b>NOTE:</b> <br />
--> Please ignore if already applied.<br />
Please ignore if already applied.<br />
</td>
</tr>
<tr>
......
......@@ -31,13 +31,11 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
columnDefs : [
{field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: false, enableSorting: false,enableFiltering:true, width:100,cellTemplate: getEmpDetTemplate},
{field : 'employeeName',displayName: 'Employee Name ', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:200},
{field : 'domain',displayName: 'Domain', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100},
{field : 'account',displayName: 'Client', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100},
{field : 'domain',displayName: 'Domain', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100},
{field : 'projectName',displayName: 'Project', enableColumnMenu: false, enableSorting: false,enableFiltering:false,width:150},
{field : 'startDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150},
{field : 'endDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150},
{field : 'functionalGroup',displayName: 'Functional Org', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100},
{field : 'emailId',displayName: 'Email Id', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100},
{field : 'startDate',displayName: 'Billing Start Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150},
{field : 'endDate',displayName: 'Billing End Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150},
{field : 'empStatus',displayName: 'Status', enableColumnMenu: false, enableSorting: true,enableFiltering: true,width:80},
{field : 'empSubStatus',displayName: 'Sub Status', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:120,cellClass:function(grid,row,col){
......@@ -53,7 +51,11 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
else if(grid.getCellValue(row,col)==='Resigned') {
return 'red';
}
}}
}},
{field : 'functionalGroup',displayName: 'Functional Org', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100},
{field : 'emailId',displayName: 'Email Id', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100},
......@@ -79,7 +81,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
exporterCsvFilename: 'AbsentDetails.csv',
exporterExcelFilename:'Employee Details',
exporterPdfDefaultStyle: {fontSize: 9},
exporterPdfTableStyle: {margin: [30, 30, 30, 30]},
exporterPdfTableStyle: {margin: [15, 15, 15, 15]},
exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'},
exporterPdfHeader: { text: "Employee Details", style: 'headerStyle' },
exporterPdfFooter: function ( currentPage, pageCount ) {
......@@ -92,7 +94,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
},
exporterPdfOrientation: 'portrait',
exporterPdfPageSize: 'LETTER',
exporterPdfMaxGridWidth: 500,
exporterPdfMaxGridWidth: 400,
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
onRegisterApi: function(gridApi){
$scope.gridApi = gridApi;
......@@ -140,7 +142,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
$scope.getEmployeesDashBoardData = function(){
$http({
method : "GET",
url : appConfig.appUri + "getEmployeesDashBoard"
url : appConfig.appUri + "resources/getEmployeesDashBoard"
}).then(function mySuccess(response) {
//alert("response"+response);
// alert("response"+response.data);
......@@ -201,7 +203,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
pageSize:10,
columnDefs : [
{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 : 'accountName',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 : 'projectStartDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150},
......@@ -271,7 +273,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
};
$http({
method : "GET",
url : appConfig.appUri + "billing?employeeId="+$scope.profile.employeeId
url : appConfig.appUri + "resources/billing?employeeId="+$scope.profile.employeeId
}).then(function mySuccess(response) {
//alert("response"+response);
// alert("response"+response.data);
......@@ -281,7 +283,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
});
$http({
method : "GET",
url : appConfig.appUri + "getMyProjectAllocations?employeeId="+$scope.profile.employeeId
url : appConfig.appUri + "resources/getMyProjectAllocations?employeeId="+$scope.profile.employeeId
}).then(function mySuccess(response) {
//alert("response"+response);
// alert("response"+response.data);
......@@ -347,4 +349,4 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
template: '<select class="form-control" ng-model="colFilter.term" ng-options="option.id as option.value for option in colFilter.options"></select>'
};
});
\ No newline at end of file
myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory, $mdDialog, $http, appConfig, $timeout, $element, $window){
$scope.records = [];
$scope.parentData = {
"employeeId": "",
"employeeName": "",
"totalHoursSpent":"",
"projectName":"",
"account":"",
"functionalOrg":""
};
var today = new Date();
var priorDt = new Date(today.getTime() - (6 * 24 * 60 * 60 * 1000));
$scope.maxDate = today;
$scope.toDate = today;
$scope.fromDate = priorDt;
// +'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.status == \'InActive\'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</i><i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="left" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>';
$scope.gridOptions = {
paginationPageSizes : [10, 20, 30, 40, 50, 100],
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
enableFiltering: true,
rowHeight:22,
columnDefs : [
{field : 'employeeId',displayName: 'Employee Id', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'employeeName',displayName: 'Employee Name', enableColumnMenu: false, enableSorting: true,enableFiltering: true},
{name : 'totalHoursSpentInWeek', displayName: 'Total Hours(HH:MM)', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width :230},
{field : 'projectName',displayName: 'Project Name', enableColumnMenu: false, enableSorting: true,enableFiltering: true},
{name : 'account', displayName: 'Account', enableColumnMenu: false, enableSorting: false, enableFiltering:false},
{name : 'functionalOrg', displayName: 'Functional Org', enableColumnMenu: false, enableSorting: false, enableFiltering:false}
],
enableGridMenu: true,
enableSelectAll: true,
exporterMenuExcel:false,
exporterMenuCsv:false,
exporterCsvFilename: '.csv',
exporterExcelFilename:'Employee Efforts Details',
exporterPdfDefaultStyle: {fontSize: 9},
exporterPdfTableStyle: {margin: [30, 30, 30, 30]},
exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'},
exporterPdfHeader: { text: "Employee Efforts Details", style: 'headerStyle' },
exporterPdfFooter: function ( currentPage, pageCount ) {
return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' };
},
exporterPdfCustomFormatter: function ( docDefinition ) {
docDefinition.styles.headerStyle = { fontSize: 22, bold: true };
docDefinition.styles.footerStyle = { fontSize: 10, bold: true };
return docDefinition;
},
exporterPdfOrientation: 'portrait',
exporterPdfPageSize: 'LETTER',
exporterPdfMaxGridWidth: 800,
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
onRegisterApi: function(gridApi){
$scope.gridApi = gridApi;
},
gridMenuCustomItems: [{
title: 'Export all data as EXCEL',
action: function ($event) {
exportUiGridService.exportToExcel('sheet 1', $scope.gridApi, 'all', 'all');
},
order: 110
},
{
title: 'Export visible data as EXCEL',
action: function ($event) {
exportUiGridService.exportToExcel('sheet 1', $scope.gridApi, 'visible', 'visible');
},
order: 111
}
]
};
$scope.gridOptions.data = $scope.records;
$scope.getEmployeeEffortsData = function(){
var fromDate = getFormattedDate($scope.fromDate);
var toDate = getFormattedDate($scope.toDate);
$http({
method : "GET",
url : appConfig.appUri + "employeeEfforts/getWeeklyReport?fromDate=" + fromDate + "&toDate=" +toDate
}).then(function mySuccess(response) {
$scope.gridOptions.data = response.data;
if(response.data.length > 10){
$scope.gridOptions.enablePaginationControls = true;
}
else{
$scope.gridOptions.enablePaginationControls = false;
}
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = [];
});
}
function getFormattedDate(date){
var day = date.getDate();
var month = date.getMonth() + 1;
var year = date.getFullYear();
return year + '-' + (month < 10 ? "0" + month : month) + '-'
+ (day < 10 ? "0" + day : day);
}
});
......@@ -217,7 +217,7 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
};
function addEmployee(record){
var urlRequest = appConfig.appUri+ "user/assignEmployeeRole";
var urlRequest = appConfig.appUri+ "employees/"+myFactory.getEmpId();
var req = {
method : 'POST',
url : urlRequest,
......@@ -263,6 +263,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" : "Employee Efforts","icon" : "fa fa-user-circle-o fa-2x","path" : "templates/employeeEfforts.html"});
}else if(role == "Delivery Lead"){
//menuItems.push({"menu" : "Manage Employees","icon" : "fa fa-user-plus fa-2x","path" : "templates/roles.html"});
//menuItems.push({"menu" : "Manage Team","icon" : "fa fa-sitemap fa-2x","path" : "templates/projectDetails.html"});
......@@ -298,6 +299,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" : "Employee Efforts ","icon" : "fa fa-user-circle-o fa-2x","path" : "templates/employeeEfforts.html"});
}else if(role == "Lead"){
menuItems.push({"menu" : "My Team","icon" : "fa fa-futbol-o fa-2x","path" : "templates/myTeam.html"});
menuItems.push({"menu" : "Reportee Login Details","icon" : "fa fa-users fa-2x","path" : "templates/reportees.html"});
......@@ -326,6 +328,7 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
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"});
menuItems.push({"menu" : "Employee Efforts","icon" : "fa fa-user-circle-o fa-2x","path" : "templates/employeeEfforts.html"});
}else{
menuItems.push({"menu" : "My Team","icon" : "fa fa-futbol-o fa-2x","path" : "templates/myTeam.html"});
menuItems.push({"menu" : "My Project Allocations","icon" : "fa fa-life-ring fa-2x","path" : "templates/myProjectAllocations.html"});
......
......@@ -14,7 +14,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
$scope.employees = [];
$scope.projects = [];
var getCellTemplate = '<div class="ui-grid-cell-contents"><a href="#" ng-click="grid.appScope.getRowData(row,\'View\')">{{COL_FIELD}}</a></div>';
var getCellActiveTemplate='<div ng-show="COL_FIELD==true"><p class="col-lg-12">Active</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">In Active</p></div>';
//var getCellActiveTemplate='<div ng-show="COL_FIELD==true"><p class="col-lg-12">Active</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">In Active</p></div>';
//var getCellTemplate = '<p class="col-lg-12"><i class="fa fa-2x" aria-hidden="true" style="font-size:1.5em;colormargin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Update\')">{{COL_FIELD}}</i></i></p>';
// var getCellActiveTemplate='<div >COL_FIELD<p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>';
......@@ -26,13 +26,13 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
enableFiltering:true,
columnDefs : [
{field : 'projectName',displayName: 'Project',cellTemplate:getCellTemplate, enableColumnMenu: true, enableSorting: true,enableFiltering:true},
{field : 'account',displayName: 'Account', enableColumnMenu: false, enableSorting: false,enableFiltering:true},
{field : 'accountName',displayName: 'Account', enableColumnMenu: false, enableSorting: false,enableFiltering:true},
{field : 'deliveryLeadIds',displayName: 'Delivery Lead',cellTemplate:'<div ng-repeat= "item in row.entity[col.field]">{{item.employeeName}}<span ng-hide="$last">,</span></div>', enableColumnMenu: false, enableSorting: false,enableFiltering:false},
{field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false, enableSorting: false,enableFiltering:false},
{field : 'projectStartDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false},
{field : 'projectEndDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false},
{field : 'billingStartDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false},
{field : 'billingEndDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false},
{field : 'shift',displayName: 'Shift', enableColumnMenu: false, enableSorting: false,enableFiltering:false},
{field : 'status',displayName: 'Status', enableColumnMenu: false,cellTemplate:getCellActiveTemplate,enableSorting: false,enableFiltering:false}
{field : 'resourceStatus',displayName: 'Status', enableColumnMenu: false,enableSorting: false,enableFiltering:false}
]
};
$scope.gridOptions.data = $scope.records;
......@@ -64,7 +64,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
$scope.getMyProjectAllocations = function(){
$http({
method : "GET",
url : appConfig.appUri + "getMyProjectAllocations?employeeId="+myFactory.getEmpId()
url : appConfig.appUri + "resources/getMyProjectAllocations?employeeId="+myFactory.getEmpId()
}).then(function mySuccess(response) {
$scope.gridOptions.data = response.data.records;
if(response.data.records.length > 10){
......@@ -117,7 +117,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
columnDefs : [
{field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: true, enableSorting: true, width:100},
{field : 'employeeName',displayName: 'Empl Name ', enableColumnMenu: false, enableSorting: false},
{field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: false},
{field : 'resourceRole',displayName: 'Role', enableColumnMenu: false, enableSorting: false},
// {field : 'emailId',displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false},
// {field : 'experience',displayName: 'Exp', enableColumnMenu: true, enableSorting: true,width:80},
{field : 'designation',displayName: 'Designation ', enableColumnMenu: false, enableSorting: false},
......
......@@ -63,7 +63,7 @@
<div class="row col-lg-12" style="height: 15px;"></div>
</div>
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-exporter
class="myGrid" style="width:99%;height:330px;">
class="myGrid grid-half-view" style="width:99%;height:330px;">
<div class="watermark" ng-show="!gridOptions.data.length">No
data available</div>
</div>
......
......@@ -41,7 +41,7 @@
<div class="row">
<div class="col-lg-12">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-exporter
class="myGrid">
class="myGrid grid-full-view">
<div class="watermark" ng-show="!gridOptions.data.length">No
data available</div>
</div>
......
......@@ -18,7 +18,7 @@
</div>
<div class="row col-lg-12" style="margin-left: 0px; margin-top: 10px">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid" style="width: 99%">
class="myGrid grid-full-view" style="width: 99%">
<div class="watermark" ng-show="!gridOptions.data.length">No
data available</div>
</div>
......
<div class="md-padding" id="popupContainer" ng-controller="assignEmployeeEffortrsController" ng-init = "getEmployeeEffortsData()">
<div class="container-fluid mainDivHeaderClass">
<div class="row">
<div class="col-lg-12">
<h1 class="no-padding">Employee Efforts
<span class="right">
<i class="fa fa-refresh" aria-hidden="true" ng-click="refreshPage()"></i>
</span>
</h1>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="form-horizontal">
<div class="form-group">
<div class="form-inline">
<div class="col-lg-4 col-md-4">
<label class="" for="toDate">To Date: <md-datepicker
ng-model="toDate" md-placeholder="Enter date"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
ng-change="validateDates(toDate, 'ToDate')"></md-datepicker></label>
</div>
<div class="col-lg-2 col-md-2">
<label class="" for="submitBtn"><md-button
class="md-raised md-primary"
ng-click="getEmployeeEffortsData('click');"> <i
class="fa fa-search fa-1x"></i>
Search</md-button></label>
</div>
</div>
</div>
<div class="form-group">
<div class="form-inline col-lg-12">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="mygrid grid-full-view">
<div class="watermark" ng-show="!gridOptions.data.length">No
data available</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -61,6 +61,7 @@
<script src="controllers/MyDetailsController.js"></script>
<script src="controllers/ReporteesController.js"></script>
<script src="controllers/ManagerReporteesController.js"></script>
<script src="controllers/EmployeeEffortsController.js"></script>
<script src="controllers/ReportsController.js"></script>
<script src="controllers/AssignRolesController.js"></script>
<script src="controllers/ProjectController.js"></script>
......
......@@ -9,7 +9,7 @@
</md-button>
</div>
</md-toolbar>
<section layout="row" style="background-color: #fafafa;padding-top: 40px;" layout-sm="column" layout-align="end end" layout-wrap>
<section layout="row" style="background-color: #fafafa;padding-top: 10px;" layout-sm="column" layout-align="end end" layout-wrap>
<md-button class="md-raised " class="pull-right" data-ng-click="addTab()" style="width:120px;background: cadetblue;color:white; " ng-show="!isSecondTab">Add</md-button>
</section>
<md-content style="height:1100px !important">
......@@ -17,7 +17,7 @@
<md-tab label="Team Details ">
<md-content class="md-padding ">
<md-dialog-content>
<div class="md-dialog-content ">
<div class="md-dialog-content " style="padding:0px">
<div class="form-group ">
<div class="row col-lg-12 " style="margin-left: 0px; ">
<div class="row col-lg-12 col-xs-12 ">
......@@ -25,6 +25,12 @@
<p>
<b>Project Name:</b> {{projectName}}
</p>
<p>
<b>Project Start Date:</b> {{projectStartDate | date : 'dd-MMM-yyyy'}}
</p>
<p>
<b>Project End Date:</b> {{projectEndDate | date : 'dd-MMM-yyyy'}}
</p>
</div>
<div class="col-xs-6 text-right ">
<p>
......@@ -94,10 +100,10 @@
</md-select>
</td>
</tr>
<tr>
<!-- <tr>
<td class="Employee">Employee Name : </td>
<td>{{employeeModel.employeeName}}</td>
</tr>
</tr> -->
<tr>
<td class="Employee"> Employee Id :</td>
<td>{{employeeModel.employeeId}}</td>
......@@ -120,7 +126,7 @@
</md-select>
</td>
</tr>
<tr>
<!-- <tr>
<td class="Employee">Shift</td>
<td>
<md-select ng-model="employeeShift" md-selected-text="getSelectedEmpShift()" id="empShift">
......@@ -129,7 +135,7 @@
</md-optgroup>
</md-select>
</td>
</tr>
</tr> -->
<tr>
<td class="Employee">Billability Status</td>
<td>
......@@ -147,16 +153,16 @@
md-max-date="maxDate " onkeydown="return false " ng-change="currentBillabilityDateChange()" name="newBillingStartDate"></md-datepicker>
</td>
</tr>
<tr>
<!-- <tr>
<td class="Employee">Start Date</td>
<td>
<md-datepicker ng-model="startDate" ng-disabled = "true" md-placeholder="Please select Date" id="startDate " md-min-date="minDate " md-max-date="maxDate "
onkeydown="return false " name="startDate"></md-datepicker>
</td>
</tr>
</tr> -->
<tr>
<td class="Employee">End Date</td>
<tr ng-show="empBillableStatus">
<td class="Employee">{{empBillableStatus}} End Date</td>
<td>
<md-datepicker ng-model="endDate" md-placeholder="Please select Date" id="endDate " md-min-date="minDate " md-max-date="maxDate "
onkeydown="return false " name="endDate"></md-datepicker>
......@@ -164,8 +170,8 @@
</tr>
</table>
<div role="alert ">
<span class="error " style="color: red; ">{{alertMsg}}</span>
<div role="alert">
<span class="alert alert alert-danger" style="color: red; ">{{alertMsg}}</span>
</div>
</div>
</div>
......@@ -245,7 +251,7 @@
</md-select>
</td>
</tr>
<tr>
<!-- <tr>
<td class="Employee">Shift</td>
<td>
<md-select ng-model="employeeShift" md-selected-text="getSelectedEmpShift()" id="empShift">
......@@ -254,7 +260,7 @@
</md-optgroup>
</md-select>
</td>
</tr>
</tr> -->
<tr>
<td class="Employee">Billability Status</td>
<td>
......@@ -275,16 +281,16 @@
</td>
</tr>
<tr>
<!-- <tr>
<td class="Employee">Start Date</td>
<td>
<md-datepicker ng-model="startDate" ng-disabled = "true" md-placeholder="Please select Date" id="startDate " md-min-date="minDate " md-max-date="maxDate "
onkeydown="return false " name="startDate"></md-datepicker>
</td>
</tr>
</tr> -->
<tr>
<td class="Employee">End Date</td>
<tr ng-show="empBillableStatus">
<td class="Employee">{{empBillableStatus}} End Date</td>
<td>
<md-datepicker ng-model="endDate " md-placeholder="Please select Date" id="endDate " md-min-date="minDate " md-max-date="maxDate "
onkeydown="return false " name="endDate"></md-datepicker>
......
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