Commit b05c283f authored by Srikanth Gajula's avatar Srikanth Gajula

MT-01:[Srikanth] Sync with new changes with mytime

parent b8078dbd
...@@ -57,4 +57,12 @@ public class AttendanceController { ...@@ -57,4 +57,12 @@ public class AttendanceController {
return new ResponseEntity<>(result, HttpStatus.OK); return new ResponseEntity<>(result, HttpStatus.OK);
} }
@RequestMapping(value = "copyRemoteMdbFileToLocal", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Boolean> copyRemoteMdbFileToLocal()
throws MyTimeException {
Boolean result = attendanceService.copyRemoteMdbFileToLocal();
return new ResponseEntity<>(result, HttpStatus.OK);
}
} }
\ No newline at end of file
...@@ -13,8 +13,10 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -13,8 +13,10 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.exception.handler.MyTimeException; import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Account;
import com.nisum.mytime.model.EmployeeRoles; import com.nisum.mytime.model.EmployeeRoles;
import com.nisum.mytime.model.Project; import com.nisum.mytime.model.Project;
import com.nisum.mytime.repository.AccountRepo;
import com.nisum.mytime.service.ProjectService; import com.nisum.mytime.service.ProjectService;
import com.nisum.mytime.service.UserService; import com.nisum.mytime.service.UserService;
...@@ -26,7 +28,8 @@ public class ProjectController { ...@@ -26,7 +28,8 @@ public class ProjectController {
private UserService userService; private UserService userService;
@Autowired @Autowired
private ProjectService projectService; private ProjectService projectService;
@Autowired
private AccountRepo accountRepo;
@RequestMapping(value = "/employee", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/employee", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<EmployeeRoles> getEmployeeRole(@RequestParam("emailId") String emailId) public ResponseEntity<EmployeeRoles> getEmployeeRole(@RequestParam("emailId") String emailId)
throws MyTimeException { throws MyTimeException {
...@@ -35,8 +38,16 @@ public class ProjectController { ...@@ -35,8 +38,16 @@ public class ProjectController {
} }
@RequestMapping(value = "/addProject", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/addProject", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Project> addProject(@RequestBody Project employeeRoles) throws MyTimeException { public ResponseEntity<Project> addProject(@RequestBody Project projectAdded) throws MyTimeException {
Project project = projectService.addProject(employeeRoles); String accountName=projectAdded.getAccount();
Account account= accountRepo.findByAccountName(accountName);
int sequenceNumber= account.getAccountProjectSequence();
account.setAccountProjectSequence(sequenceNumber+1);
accountRepo.save(account);
String projectId= accountName+String.format("%04d", sequenceNumber+1);
projectAdded.setProjectId(projectId);
Project project = projectService.addProject(projectAdded);
System.out.println(project.getProjectId());
return new ResponseEntity<>(project, HttpStatus.OK); return new ResponseEntity<>(project, HttpStatus.OK);
} }
......
...@@ -27,6 +27,7 @@ public class ProjectTeamController { ...@@ -27,6 +27,7 @@ public class ProjectTeamController {
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired @Autowired
private ProjectService projectService; private ProjectService projectService;
...@@ -121,18 +122,21 @@ public class ProjectTeamController { ...@@ -121,18 +122,21 @@ public class ProjectTeamController {
List<EmployeeRoles> employeesRoles = projectService.getUnAssignedEmployees(); List<EmployeeRoles> employeesRoles = projectService.getUnAssignedEmployees();
return new ResponseEntity<>(employeesRoles, HttpStatus.OK); return new ResponseEntity<>(employeesRoles, HttpStatus.OK);
} }
@RequestMapping(value = "/getShiftDetails", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/getShiftDetails", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<ProjectTeamMate>> getShiftDetails(@RequestParam("shift") String shift) public ResponseEntity<List<ProjectTeamMate>> getShiftDetails(@RequestParam("shift") String shift)
throws MyTimeException { throws MyTimeException {
List<ProjectTeamMate> employeesRoles = projectService.getShiftDetails(shift); List<ProjectTeamMate> employeesRoles = projectService.getShiftDetails(shift);
return new ResponseEntity<>(employeesRoles, HttpStatus.OK); return new ResponseEntity<>(employeesRoles, HttpStatus.OK);
} }
@RequestMapping(value = "/getProjectAllocations", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/getProjectAllocations", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<ProjectTeamMate>> getProjectAllocations() public ResponseEntity<List<ProjectTeamMate>> getProjectAllocations()
throws MyTimeException { throws MyTimeException {
List<ProjectTeamMate> employeesRoles = projectService.getAllProjectDetails(); List<ProjectTeamMate> employeesRoles = projectService.getAllProjectDetails();
return new ResponseEntity<>(employeesRoles, HttpStatus.OK); return new ResponseEntity<>(employeesRoles, HttpStatus.OK);
} }
@RequestMapping(value = "/getProjectDetails", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/getProjectDetails", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<ProjectTeamMate>> getProjectDetails(@RequestParam("projectId") String projectId) public ResponseEntity<List<ProjectTeamMate>> getProjectDetails(@RequestParam("projectId") String projectId)
throws MyTimeException { throws MyTimeException {
......
package com.nisum.mytime.controller; package com.nisum.mytime.controller;
import java.util.ArrayList; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -15,9 +15,11 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -15,9 +15,11 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.exception.handler.MyTimeException; import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Account;
import com.nisum.mytime.model.Designation; import com.nisum.mytime.model.Designation;
import com.nisum.mytime.model.EmployeeRoles; import com.nisum.mytime.model.EmployeeRoles;
import com.nisum.mytime.model.Shift; import com.nisum.mytime.model.Shift;
import com.nisum.mytime.model.Skill;
import com.nisum.mytime.service.UserService; import com.nisum.mytime.service.UserService;
@RestController @RestController
...@@ -35,13 +37,15 @@ public class UserController { ...@@ -35,13 +37,15 @@ public class UserController {
} }
@RequestMapping(value = "/assignEmployeeRole", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/assignEmployeeRole", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<EmployeeRoles> assigingEmployeeRole(@RequestBody EmployeeRoles employeeRoles) throws MyTimeException { public ResponseEntity<EmployeeRoles> assigingEmployeeRole(@RequestBody EmployeeRoles employeeRoles)
throws MyTimeException {
EmployeeRoles employeeRole = userService.assigingEmployeeRole(employeeRoles); EmployeeRoles employeeRole = userService.assigingEmployeeRole(employeeRoles);
return new ResponseEntity<>(employeeRole, HttpStatus.OK); return new ResponseEntity<>(employeeRole, HttpStatus.OK);
} }
@RequestMapping(value = "/updateEmployeeRole", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/updateEmployeeRole", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<EmployeeRoles> updateEmployeeRole(@RequestBody EmployeeRoles employeeRoles) throws MyTimeException { public ResponseEntity<EmployeeRoles> updateEmployeeRole(@RequestBody EmployeeRoles employeeRoles)
throws MyTimeException {
EmployeeRoles employeeRole = userService.updateEmployeeRole(employeeRoles); EmployeeRoles employeeRole = userService.updateEmployeeRole(employeeRoles);
return new ResponseEntity<>(employeeRole, HttpStatus.OK); return new ResponseEntity<>(employeeRole, HttpStatus.OK);
} }
...@@ -64,27 +68,60 @@ public class UserController { ...@@ -64,27 +68,60 @@ public class UserController {
EmployeeRoles employeesRole = userService.getEmployeesRoleData(empId); EmployeeRoles employeesRole = userService.getEmployeesRoleData(empId);
return new ResponseEntity<>(employeesRole, HttpStatus.OK); return new ResponseEntity<>(employeesRole, HttpStatus.OK);
} }
@RequestMapping(value = "/getManagers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/getManagers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<EmployeeRoles>> getManagers() throws MyTimeException { public ResponseEntity<List<EmployeeRoles>> getManagers() throws MyTimeException {
List<EmployeeRoles> employeesRoles = userService.getEmployeeRoles(); List<EmployeeRoles> employeesRoles = userService.getEmployeeRoles();
List<EmployeeRoles> managers = employeesRoles.stream().filter(e -> (e.getRole().equalsIgnoreCase("Manager")||e.getRole().equalsIgnoreCase("HR Manager")||e.getRole().equalsIgnoreCase("Lead"))).collect(Collectors.toList()); List<EmployeeRoles> managers = employeesRoles
.stream().filter(e -> ("Manager".equalsIgnoreCase(e.getRole())
|| "HR Manager".equalsIgnoreCase(e.getRole()) || "Lead".equalsIgnoreCase(e.getRole())))
.sorted(Comparator.comparing(EmployeeRoles::getEmployeeName)).collect(Collectors.toList());
return new ResponseEntity<>(managers, HttpStatus.OK); return new ResponseEntity<>(managers, HttpStatus.OK);
} }
@RequestMapping(value = "/getAllShifts", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/getAllShifts", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<String>> getAllShifts() throws MyTimeException { public ResponseEntity<List<String>> getAllShifts() throws MyTimeException {
List<String> shifts = new ArrayList<>(); List<String> shifts = userService.getAllShifts().stream().filter(e -> "Y".equalsIgnoreCase(e.getActiveStatus()))
.map(Shift::getShiftName).sorted().collect(Collectors.toList());
shifts = userService.getAllShifts().stream().filter(e -> e.getActiveStatus().equalsIgnoreCase("Y")).map(Shift::getShiftName) .collect(Collectors.toList());
return new ResponseEntity<>(shifts, HttpStatus.OK); return new ResponseEntity<>(shifts, HttpStatus.OK);
} }
@RequestMapping(value = "/getAllDesignations", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/getAllDesignations", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<String>> getAllDesignations() throws MyTimeException { public ResponseEntity<List<String>> getAllDesignations() throws MyTimeException {
List<String> designations = new ArrayList<>(); List<String> designations = userService.getAllDesignations().stream()
.filter(e -> "Y".equalsIgnoreCase(e.getActiveStatus())).map(Designation::getDesignationName).sorted()
.collect(Collectors.toList());
return new ResponseEntity<>(designations, HttpStatus.OK);
}
designations = userService.getAllDesignations().stream().filter(e -> e.getActiveStatus().equalsIgnoreCase("Y")).map(Designation::getDesignationName) .collect(Collectors.toList()); @RequestMapping(value = "/getSkills", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<String>> getTechnologies() throws MyTimeException {
List<String> technologies = userService.getTechnologies().stream()
.filter(e -> "Y".equalsIgnoreCase(e.getActiveStatus())).map(Skill::getSkillName).sorted()
.collect(Collectors.toList());
return new ResponseEntity<>(technologies, HttpStatus.OK);
return new ResponseEntity<>(designations, HttpStatus.OK);
} }
@RequestMapping(value = "/updateProfile", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<EmployeeRoles> updateProfile(@RequestBody EmployeeRoles employeeRoles)
throws MyTimeException {
EmployeeRoles employeeDB = userService.getEmployeesRoleData(employeeRoles.getEmployeeId());
employeeDB.setMobileNumber(employeeRoles.getMobileNumber());
employeeDB.setAlternateMobileNumber(employeeRoles.getAlternateMobileNumber());
employeeDB.setPersonalEmailId(employeeRoles.getPersonalEmailId());
employeeDB.setBaseTechnology(employeeRoles.getBaseTechnology());
employeeDB.setTechnologyKnown(employeeRoles.getTechnologyKnown());
EmployeeRoles employeeRole = userService.updateProfile(employeeDB);
return new ResponseEntity<>(employeeRole, HttpStatus.OK);
}
@RequestMapping(value = "/getAccounts", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<String>> getAccounts() throws MyTimeException {
List<String> technologies = userService.getAccounts().stream()
.filter(e -> "Y".equalsIgnoreCase(e.getStatus())).map(Account::getAccountName).sorted()
.collect(Collectors.toList());
System.out.println("technologies"+technologies);
return new ResponseEntity<>(technologies, HttpStatus.OK);
}
} }
\ No newline at end of file
package com.nisum.mytime.model;
import java.io.Serializable;
import java.util.List;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "Accounts")
public class Account implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private ObjectId id;
private String accountId;
private String accountName;
private int accountProjectSequence;
private String status;
}
package com.nisum.mytime.model; package com.nisum.mytime.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
import org.bson.types.ObjectId; import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
...@@ -21,7 +20,6 @@ import lombok.ToString; ...@@ -21,7 +20,6 @@ import lombok.ToString;
@Document(collection = "Designations") @Document(collection = "Designations")
public class Designation implements Serializable { public class Designation implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
......
...@@ -32,7 +32,13 @@ public class EmployeeRoles implements Serializable { ...@@ -32,7 +32,13 @@ public class EmployeeRoles implements Serializable {
private String emailId; private String emailId;
private String role; private String role;
private String shift; private String shift;
private String baseTechnology;
private String technologyKnown;
private String mobileNumber;
private String alternateMobileNumber;
private String personalEmailId;
private Date createdOn; private Date createdOn;
private Date lastModifiedOn; private Date lastModifiedOn;
} }
...@@ -30,6 +30,7 @@ public class Project implements Serializable { ...@@ -30,6 +30,7 @@ public class Project implements Serializable {
private String projectName; private String projectName;
private String managerId; private String managerId;
private String managerName; private String managerName;
private String account;
private String status; private String status;
private List<String> employeeIds; private List<String> employeeIds;
......
...@@ -31,6 +31,7 @@ public class ProjectTeamMate implements Serializable { ...@@ -31,6 +31,7 @@ public class ProjectTeamMate implements Serializable {
private String shift; private String shift;
private String projectId; private String projectId;
private String projectName; private String projectName;
private String account;
private String managerId; private String managerId;
private String managerName; private String managerName;
private String experience; private String experience;
......
package com.nisum.mytime.model; package com.nisum.mytime.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
import org.bson.types.ObjectId; import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
...@@ -21,7 +20,6 @@ import lombok.ToString; ...@@ -21,7 +20,6 @@ import lombok.ToString;
@Document(collection = "Shifts") @Document(collection = "Shifts")
public class Shift implements Serializable { public class Shift implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
...@@ -30,5 +28,4 @@ public class Shift implements Serializable { ...@@ -30,5 +28,4 @@ public class Shift implements Serializable {
private String shiftName; private String shiftName;
private String activeStatus; private String activeStatus;
} }
package com.nisum.mytime.model;
import java.io.Serializable;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "Skills")
public class Skill implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private ObjectId id;
private String skillId;
private String skillName;
private String activeStatus;
}
package com.nisum.mytime.repository;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.Account;
public interface AccountRepo extends MongoRepository<Account, String> {
Account findByAccountName(String accontName);
}
\ No newline at end of file
package com.nisum.mytime.repository; package com.nisum.mytime.repository;
import java.util.List;
import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.Designation; import com.nisum.mytime.model.Designation;
public interface DesignationRepo extends MongoRepository<Designation, String> { public interface DesignationRepo extends MongoRepository<Designation, String> {
} }
\ No newline at end of file
package com.nisum.mytime.repository; package com.nisum.mytime.repository;
import java.util.List;
import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.Shift; import com.nisum.mytime.model.Shift;
......
package com.nisum.mytime.repository;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.Skill;
public interface TechnologyRepo extends MongoRepository<Skill, String> {
}
\ No newline at end of file
...@@ -10,4 +10,6 @@ public interface AttendanceService { ...@@ -10,4 +10,6 @@ public interface AttendanceService {
List<AttendenceData> getAttendanciesReport(String reportDate) throws MyTimeException, SQLException; List<AttendenceData> getAttendanciesReport(String reportDate) throws MyTimeException, SQLException;
Boolean copyRemoteMdbFileToLocal() throws MyTimeException;
} }
package com.nisum.mytime.service; package com.nisum.mytime.service;
import java.io.File; import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.sql.Connection; import java.sql.Connection;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
...@@ -13,6 +15,7 @@ import java.util.List; ...@@ -13,6 +15,7 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.apache.commons.lang.time.DateUtils; import org.apache.commons.lang.time.DateUtils;
import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
...@@ -27,6 +30,8 @@ import com.nisum.mytime.model.AttendenceData; ...@@ -27,6 +30,8 @@ import com.nisum.mytime.model.AttendenceData;
import com.nisum.mytime.utils.MyTimeLogger; import com.nisum.mytime.utils.MyTimeLogger;
import com.nisum.mytime.utils.MyTimeUtils; import com.nisum.mytime.utils.MyTimeUtils;
import jcifs.smb.SmbFile;
@Service @Service
public class AttendanceServiceImpl implements AttendanceService { public class AttendanceServiceImpl implements AttendanceService {
...@@ -36,6 +41,12 @@ public class AttendanceServiceImpl implements AttendanceService { ...@@ -36,6 +41,12 @@ public class AttendanceServiceImpl implements AttendanceService {
@Value("${mytime.localFile.directory}") @Value("${mytime.localFile.directory}")
private String localFileDirectory; private String localFileDirectory;
@Value("${mytime.remote.directory}")
private String remoteFilesDirectory;
@Value("${mytime.remote.connection}")
private String remotePath;
@Autowired @Autowired
private MongoTemplate mongoTemplate; private MongoTemplate mongoTemplate;
...@@ -105,9 +116,9 @@ public class AttendanceServiceImpl implements AttendanceService { ...@@ -105,9 +116,9 @@ public class AttendanceServiceImpl implements AttendanceService {
Date maxTimeToLogin = DateUtils.addHours(dayStartsTime, 12); Date maxTimeToLogin = DateUtils.addHours(dayStartsTime, 12);
queryMonthDecider.append(MyTimeUtils.USERID_QUERY); queryMonthDecider.append(MyTimeUtils.USERID_QUERY);
queryMonthDecider.append(month); queryMonthDecider.append(calendar.get(Calendar.MONTH) + 1);
queryMonthDecider.append(MyTimeUtils.UNDER_SCORE); queryMonthDecider.append(MyTimeUtils.UNDER_SCORE);
queryMonthDecider.append(year); queryMonthDecider.append(calendar.get(Calendar.YEAR));
queryMonthDecider.append(MyTimeUtils.WHERE_COND); queryMonthDecider.append(MyTimeUtils.WHERE_COND);
queryMonthDecider.append(MyTimeUtils.df.format(dayStartsTime) + MyTimeUtils.SINGLE_QUOTE); queryMonthDecider.append(MyTimeUtils.df.format(dayStartsTime) + MyTimeUtils.SINGLE_QUOTE);
queryMonthDecider.append(MyTimeUtils.AND_COND); queryMonthDecider.append(MyTimeUtils.AND_COND);
...@@ -198,4 +209,27 @@ public class AttendanceServiceImpl implements AttendanceService { ...@@ -198,4 +209,27 @@ public class AttendanceServiceImpl implements AttendanceService {
return listOfAbsentEmployees; return listOfAbsentEmployees;
} }
public Boolean copyRemoteMdbFileToLocal() throws MyTimeException {
File Finalfile = null;
boolean result = false;
try {
SmbFile[] smbFiles = new SmbFile(remotePath).listFiles();
for (SmbFile file : smbFiles) {
if (file.getCanonicalPath().contains(mdbFile)) {
Finalfile = new File(localFileDirectory + file.getName());
try (InputStream in = file.getInputStream();
FileOutputStream out = new FileOutputStream(Finalfile)) {
IOUtils.copy(in, out);
result = true;
}
}
}
} catch (Exception e) {
MyTimeLogger.getInstance().error(e.getMessage());
throw new MyTimeException(e.getMessage());
}
return result;
}
} }
...@@ -39,7 +39,10 @@ public interface ProjectService { ...@@ -39,7 +39,10 @@ public interface ProjectService {
List<ProjectTeamMate> getMyTeamDetails(String empId); List<ProjectTeamMate> getMyTeamDetails(String empId);
List<EmployeeRoles> getUnAssignedEmployees(); List<EmployeeRoles> getUnAssignedEmployees();
public List<ProjectTeamMate> getShiftDetails(String shift);
public List<ProjectTeamMate> getAllProjectDetails(); List<ProjectTeamMate> getShiftDetails(String shift);
public List<ProjectTeamMate> getProjectDetails(String projectId);
List<ProjectTeamMate> getAllProjectDetails();
List<ProjectTeamMate> getProjectDetails(String projectId);
} }
...@@ -78,13 +78,26 @@ public class ProjectServiceImpl implements ProjectService { ...@@ -78,13 +78,26 @@ public class ProjectServiceImpl implements ProjectService {
public Project updateProject(Project project) { public Project updateProject(Project project) {
Query query = new Query(Criteria.where("projectId").is(project.getProjectId())); Query query = new Query(Criteria.where("projectId").is(project.getProjectId()));
Update update = new Update(); Update update = new Update();
update.set("projectName", project.getProjectName());
update.set("managerId", project.getManagerId()); update.set("managerId", project.getManagerId());
update.set("managerName", project.getManagerName()); update.set("managerName", project.getManagerName());
update.set("account", project.getAccount());
update.set("status", project.getStatus()); update.set("status", project.getStatus());
FindAndModifyOptions options = new FindAndModifyOptions(); FindAndModifyOptions options = new FindAndModifyOptions();
options.returnNew(true); options.returnNew(true);
options.upsert(true); options.upsert(true);
return mongoTemplate.findAndModify(query, update, options, Project.class); Project projectDB= mongoTemplate.findAndModify(query, update, options, Project.class);
List<ProjectTeamMate> employeeDetails= projectTeamMatesRepo.findByProjectId(project.getProjectId());
if(employeeDetails!=null&&projectDB!=null) {
for (ProjectTeamMate emp : employeeDetails) {
emp.setManagerId(projectDB.getManagerId());
emp.setManagerName(projectDB.getManagerName());
emp.setAccount(projectDB.getAccount());
emp.setProjectName(projectDB.getProjectName());
projectTeamMatesRepo.save(emp);
}
}
return projectDB;
} }
@Override @Override
...@@ -115,7 +128,15 @@ public class ProjectServiceImpl implements ProjectService { ...@@ -115,7 +128,15 @@ public class ProjectServiceImpl implements ProjectService {
existingTeammate.setBillableStatus(projectTeamMate.getBillableStatus()); existingTeammate.setBillableStatus(projectTeamMate.getBillableStatus());
existingTeammate.setMobileNumber(projectTeamMate.getMobileNumber()); existingTeammate.setMobileNumber(projectTeamMate.getMobileNumber());
existingTeammate.setShift(projectTeamMate.getShift()); existingTeammate.setShift(projectTeamMate.getShift());
return projectTeamMatesRepo.save(existingTeammate); ProjectTeamMate teamMate= projectTeamMatesRepo.save(existingTeammate);
try {
EmployeeRoles employeeDB= employeeRolesRepo.findByEmployeeId(teamMate.getEmployeeId());
employeeDB.setShift(teamMate.getShift());
employeeDB.setMobileNumber(teamMate.getMobileNumber());
employeeRolesRepo.save(employeeDB);
}
catch(Exception e) {}
return teamMate;
} }
@Override @Override
......
...@@ -3,10 +3,12 @@ package com.nisum.mytime.service; ...@@ -3,10 +3,12 @@ package com.nisum.mytime.service;
import java.util.List; import java.util.List;
import com.nisum.mytime.exception.handler.MyTimeException; import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Account;
import com.nisum.mytime.model.Designation; import com.nisum.mytime.model.Designation;
import com.nisum.mytime.model.EmpLoginData; import com.nisum.mytime.model.EmpLoginData;
import com.nisum.mytime.model.EmployeeRoles; import com.nisum.mytime.model.EmployeeRoles;
import com.nisum.mytime.model.Shift; import com.nisum.mytime.model.Shift;
import com.nisum.mytime.model.Skill;
public interface UserService { public interface UserService {
...@@ -29,5 +31,12 @@ public interface UserService { ...@@ -29,5 +31,12 @@ public interface UserService {
EmployeeRoles getEmployeesRoleData(String empId); EmployeeRoles getEmployeesRoleData(String empId);
List<Shift> getAllShifts() throws MyTimeException; List<Shift> getAllShifts() throws MyTimeException;
List<Designation> getAllDesignations() throws MyTimeException; List<Designation> getAllDesignations() throws MyTimeException;
List<Skill> getTechnologies() throws MyTimeException;
public EmployeeRoles updateProfile(EmployeeRoles employeeRoles) throws MyTimeException;
public List<Account> getAccounts() throws MyTimeException;
} }
...@@ -12,13 +12,19 @@ import org.springframework.data.mongodb.core.query.Update; ...@@ -12,13 +12,19 @@ import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.nisum.mytime.exception.handler.MyTimeException; import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Account;
import com.nisum.mytime.model.Designation; import com.nisum.mytime.model.Designation;
import com.nisum.mytime.model.EmpLoginData; import com.nisum.mytime.model.EmpLoginData;
import com.nisum.mytime.model.EmployeeRoles; import com.nisum.mytime.model.EmployeeRoles;
import com.nisum.mytime.model.ProjectTeamMate;
import com.nisum.mytime.model.Shift; import com.nisum.mytime.model.Shift;
import com.nisum.mytime.model.Skill;
import com.nisum.mytime.repository.AccountRepo;
import com.nisum.mytime.repository.DesignationRepo; import com.nisum.mytime.repository.DesignationRepo;
import com.nisum.mytime.repository.EmployeeRolesRepo; import com.nisum.mytime.repository.EmployeeRolesRepo;
import com.nisum.mytime.repository.ProjectTeamMatesRepo;
import com.nisum.mytime.repository.ShiftRepo; import com.nisum.mytime.repository.ShiftRepo;
import com.nisum.mytime.repository.TechnologyRepo;
import com.nisum.mytime.utils.PdfReportGenerator; import com.nisum.mytime.utils.PdfReportGenerator;
@Service("userService") @Service("userService")
...@@ -26,13 +32,20 @@ public class UserServiceImpl implements UserService { ...@@ -26,13 +32,20 @@ public class UserServiceImpl implements UserService {
@Autowired @Autowired
private EmployeeRolesRepo employeeRolesRepo; private EmployeeRolesRepo employeeRolesRepo;
@Autowired
private ProjectTeamMatesRepo projectTeamMatesRepo;
@Autowired @Autowired
private ShiftRepo shiftRepo; private ShiftRepo shiftRepo;
@Autowired @Autowired
private DesignationRepo designationRepo; private DesignationRepo designationRepo;
@Autowired
private AccountRepo accountRepo;
@Autowired
private TechnologyRepo technologyRepo;
@Autowired @Autowired
private EmployeeDataService employeeDataBaseService; private EmployeeDataService employeeDataBaseService;
...@@ -110,5 +123,37 @@ public class UserServiceImpl implements UserService { ...@@ -110,5 +123,37 @@ public class UserServiceImpl implements UserService {
public List<Designation> getAllDesignations() throws MyTimeException { public List<Designation> getAllDesignations() throws MyTimeException {
return designationRepo.findAll(); return designationRepo.findAll();
} }
@Override
public List<Account> getAccounts() throws MyTimeException {
return accountRepo.findAll();
}
@Override
public List<Skill> getTechnologies() throws MyTimeException {
return technologyRepo.findAll();
}
@Override
public EmployeeRoles updateProfile(EmployeeRoles employeeRoles) throws MyTimeException {
boolean mobileNumberChnaged=false;
employeeRoles.setLastModifiedOn(new Date());
EmployeeRoles existingEmployee=employeeRolesRepo.findByEmployeeId(employeeRoles.getEmployeeId());
String newMobileNumber=employeeRoles.getMobileNumber();
if(newMobileNumber!=null&&!newMobileNumber.equalsIgnoreCase("")) {
if((existingEmployee!=null&&existingEmployee.getMobileNumber()!=null&&!existingEmployee.getMobileNumber().equalsIgnoreCase(newMobileNumber) )|| (existingEmployee.getMobileNumber()==null )){
mobileNumberChnaged=true;
}
}
EmployeeRoles employeeRolesDB= employeeRolesRepo.save(employeeRoles);
if(mobileNumberChnaged) {
try {
List<ProjectTeamMate> employeeProfiles= projectTeamMatesRepo.findByEmployeeId(employeeRoles.getEmployeeId());
if(employeeProfiles!=null&&!employeeProfiles.isEmpty()) {
for(ProjectTeamMate profile:employeeProfiles){
profile.setMobileNumber(employeeRolesDB.getMobileNumber());
projectTeamMatesRepo.save(profile);
}
}}catch(Exception e) {}
}
return employeeRolesDB;
}
} }
...@@ -23,7 +23,7 @@ mytime.attendance.fileName=eTimeTrackLite1.mdb ...@@ -23,7 +23,7 @@ mytime.attendance.fileName=eTimeTrackLite1.mdb
#Local configuration purpose #Local configuration purpose
mytime.remote.connection=smb://MyTime:nisum@192.168.15.67/eTimeTrackLite/ mytime.remote.connection=smb://MyTime:nisum@192.168.15.67/eTimeTrackLite/
mytime.localFile.directory=/Users/nisum/Documents/ mytime.localFile.directory=/home/nisum/Documents/
#Mail configuration #Mail configuration
spring.mail.host=smtp.gmail.com spring.mail.host=smtp.gmail.com
...@@ -33,3 +33,6 @@ spring.mail.password=nisum@123 ...@@ -33,3 +33,6 @@ spring.mail.password=nisum@123
spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true spring.mail.properties.mail.smtp.starttls.required=true
#Spring boot favicon related
spring.mvc.favicon.enabled = false
\ No newline at end of file
...@@ -6,7 +6,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -6,7 +6,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
"employeeName": "", "employeeName": "",
"emailId":"", "emailId":"",
"role": "", "role": "",
"shift": "",
"action":"" "action":""
}; };
...@@ -23,7 +22,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -23,7 +22,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
{field : 'employeeName',displayName: 'Name', enableColumnMenu: false, enableSorting: false}, {field : 'employeeName',displayName: 'Name', enableColumnMenu: false, enableSorting: false},
{field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false}, {field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false},
{field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: false, width:100}, {field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: false, width:100},
//{field : 'shift',displayName: 'Shift', enableColumnMenu: false, enableSorting: false},
{name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, width:100} {name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, width:100}
] ]
}; };
...@@ -34,7 +32,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -34,7 +32,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.parentData.employeeName = row.entity.employeeName; $scope.parentData.employeeName = row.entity.employeeName;
$scope.parentData.emailId = row.entity.emailId; $scope.parentData.emailId = row.entity.emailId;
$scope.parentData.role = row.entity.role; $scope.parentData.role = row.entity.role;
$scope.parentData.shift = row.entity.shift;
if(action == "Update") if(action == "Update")
$scope.assignRole(action, $scope.parentData); $scope.assignRole(action, $scope.parentData);
else if(action == "Delete") else if(action == "Delete")
...@@ -117,6 +114,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -117,6 +114,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
} }
$scope.assignRole = function(action, userData){ $scope.assignRole = function(action, userData){
$('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
$mdDialog.show({ $mdDialog.show({
controller: AddRoleController, controller: AddRoleController,
...@@ -138,7 +136,9 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -138,7 +136,9 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}; };
$scope.deleteRole = function(row){ $scope.deleteRole = function(row){
$('#home').addClass('md-scroll-mask');
var confirm = $mdDialog.confirm() var confirm = $mdDialog.confirm()
.clickOutsideToClose(true)
.textContent('Are you sure want to delete the role?') .textContent('Are you sure want to delete the role?')
.ok('Ok') .ok('Ok')
.cancel('Cancel'); .cancel('Cancel');
...@@ -183,19 +183,16 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -183,19 +183,16 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.empId = ""; $scope.empId = "";
$scope.empName = ""; $scope.empName = "";
$scope.empRole; $scope.empRole;
$scope.empShift;
$scope.empEmail = ""; $scope.empEmail = "";
$scope.isDisabled = false; $scope.isDisabled = false;
}else if(dataToPass.action == "Update"){ }else if(dataToPass.action == "Update"){
$scope.empId = dataToPass.employeeId; $scope.empId = dataToPass.employeeId;
$scope.empName = dataToPass.employeeName; $scope.empName = dataToPass.employeeName;
$scope.empRole = dataToPass.role; $scope.empRole = dataToPass.role;
$scope.empShift = dataToPass.shift;
$scope.empEmail = dataToPass.emailId; $scope.empEmail = dataToPass.emailId;
$scope.isDisabled = true; $scope.isDisabled = true;
} }
$scope.roles = ["HR","Manager","Employee","HR Manager","Director","Lead"]; $scope.roles = ["Director","Employee","HR","HR Manager","Lead","Manager"];
$scope.shifts = myFactory.getShifts();//["Shift 1(09:00 AM - 06:00 PM)","Shift 2(03:30 PM - 12:30 PM)", "Shift 3(09:00 PM - 06:00 AM)"];
$scope.getSelectedRole = function(){ $scope.getSelectedRole = function(){
if ($scope.empRole !== undefined) { if ($scope.empRole !== undefined) {
return $scope.empRole; return $scope.empRole;
...@@ -204,14 +201,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -204,14 +201,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
} }
}; };
$scope.getSelectedShift = function(){
if ($scope.empShift !== undefined) {
return $scope.empShift;
} else {
return "Please select a shift";
}
};
$scope.validateEmpId = function(){ $scope.validateEmpId = function(){
var searchId = $scope.empId; var searchId = $scope.empId;
if(searchId != "" && isNaN(searchId)){ if(searchId != "" && isNaN(searchId)){
...@@ -268,7 +257,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -268,7 +257,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
var searchId = $scope.empId; var searchId = $scope.empId;
var empName = $scope.empName; var empName = $scope.empName;
var empRole = $scope.empRole; var empRole = $scope.empRole;
var empShift = $scope.empShift;
var empEmail = $scope.empEmail; var empEmail = $scope.empEmail;
if(searchId == ""){ if(searchId == ""){
$scope.alertMsg = "Employee ID is mandatory"; $scope.alertMsg = "Employee ID is mandatory";
...@@ -288,12 +276,9 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -288,12 +276,9 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}else if(empRole == undefined){ }else if(empRole == undefined){
$scope.alertMsg = "Please select a role"; $scope.alertMsg = "Please select a role";
document.getElementById('empRole').focus(); document.getElementById('empRole').focus();
}else if(empShift == undefined){
$scope.alertMsg = "Please select a shift";
document.getElementById('empShift').focus();
}else{ }else{
$scope.alertMsg = ""; $scope.alertMsg = "";
var record = {"employeeId":$scope.empId, "employeeName": $scope.empName, "emailId": $scope.empEmail, "role": $scope.empRole, "shift": $scope.empShift}; var record = {"employeeId":$scope.empId, "employeeName": $scope.empName, "emailId": $scope.empEmail, "role": $scope.empRole};
addOrUpdateRole(record, $scope.templateTitle); addOrUpdateRole(record, $scope.templateTitle);
$timeout(function(){updateGrid($scope.templateTitle, record)},500); $timeout(function(){updateGrid($scope.templateTitle, record)},500);
} }
......
...@@ -62,6 +62,7 @@ myApp.controller("attendanceReportController", function($scope, $http, myFactory ...@@ -62,6 +62,7 @@ myApp.controller("attendanceReportController", function($scope, $http, myFactory
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
$scope.getEmployeePresent = function(type){ $scope.getEmployeePresent = function(type){
$mdDialog.hide();
if(type == "onload"){ if(type == "onload"){
showProgressDialog("Fetching data please wait..."); showProgressDialog("Fetching data please wait...");
} }
...@@ -83,7 +84,6 @@ myApp.controller("attendanceReportController", function($scope, $http, myFactory ...@@ -83,7 +84,6 @@ myApp.controller("attendanceReportController", function($scope, $http, myFactory
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
$scope.totalPresent = response.data[0].totalPresent; $scope.totalPresent = response.data[0].totalPresent;
$scope.totalAbsent = response.data[0].totalAbsent; $scope.totalAbsent = response.data[0].totalAbsent;
$scope.totalEmployees = response.data[0].totalPresent + response.data[0].totalAbsent;
} }
}, function myError(response) { }, function myError(response) {
showAlert("Something went wrong while fetching data!!!"); showAlert("Something went wrong while fetching data!!!");
...@@ -121,6 +121,7 @@ myApp.controller("attendanceReportController", function($scope, $http, myFactory ...@@ -121,6 +121,7 @@ myApp.controller("attendanceReportController", function($scope, $http, myFactory
} }
function showProgressDialog(msg){ function showProgressDialog(msg){
$('#home').addClass('md-scroll-mask');
$mdDialog.show({ $mdDialog.show({
templateUrl: 'templates/progressDialog.html', templateUrl: 'templates/progressDialog.html',
controller: ProgressController, controller: ProgressController,
......
...@@ -13,6 +13,8 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window ...@@ -13,6 +13,8 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
getAllUserRoles(); getAllUserRoles();
getAllShifts(); getAllShifts();
getAllDesignations(); getAllDesignations();
getAllTechnologies();
getAllAccounts();
} }
function onFailure(error){ function onFailure(error){
...@@ -64,7 +66,6 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window ...@@ -64,7 +66,6 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
myFactory.setShifts(response.data); myFactory.setShifts(response.data);
}, function myError(response) { }, function myError(response) {
$scope.shifts = [];
}); });
}; };
function getAllDesignations(){ function getAllDesignations(){
...@@ -74,7 +75,26 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window ...@@ -74,7 +75,26 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
myFactory.setDesignations(response.data); myFactory.setDesignations(response.data);
}, function myError(response) { }, function myError(response) {
$scope.shifts = []; });
};
function getAllTechnologies(){
$http({
method : "GET",
url : appConfig.appUri + "user/getSkills"
}).then(function mySuccess(response) {
myFactory.setTechnologies(response.data);
}, function myError(response) {
});
};
function getAllAccounts(){
$http({
method : "GET",
url : appConfig.appUri + "user/getAccounts"
}).then(function mySuccess(response) {
myFactory.setAccounts(response.data);
}, function myError(response) {
}); });
}; };
function showRegisterEmployeeScreen(profile){ function showRegisterEmployeeScreen(profile){
...@@ -106,14 +126,13 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window ...@@ -106,14 +126,13 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
$scope.empName = dataToPass.getName(); $scope.empName = dataToPass.getName();
$scope.empEmail = dataToPass.getEmail(); $scope.empEmail = dataToPass.getEmail();
$scope.empShift; $scope.empShift;
$scope.shifts = myFactory.getTechnologies(); //["Shift 1(09:00 AM - 06:00 PM)","Shift 2(03:30 PM - 12:30 PM)", "Shift 3(09:00 PM - 06:00 AM)"];
$scope.shifts = myFactory.getShifts(); //["Shift 1(09:00 AM - 06:00 PM)","Shift 2(03:30 PM - 12:30 PM)", "Shift 3(09:00 PM - 06:00 AM)"];
$scope.getSelectedShift = function(){ $scope.getSelectedShift = function(){
if ($scope.empShift !== undefined) { if ($scope.empShift !== undefined) {
return $scope.empShift; return $scope.empShift;
} else { } else {
return "Please select a shift"; return "Please select primary skill";
} }
}; };
...@@ -153,6 +172,8 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window ...@@ -153,6 +172,8 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
var searchId = $scope.empId; var searchId = $scope.empId;
var empName = $scope.empName; var empName = $scope.empName;
var empShift = $scope.empShift; var empShift = $scope.empShift;
var mobileNumber = $scope.mobileNumber;
if(searchId == ""){ if(searchId == ""){
$scope.alertMsg = "Employee ID is mandatory"; $scope.alertMsg = "Employee ID is mandatory";
document.getElementById('empId').focus(); document.getElementById('empId').focus();
...@@ -165,12 +186,15 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window ...@@ -165,12 +186,15 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
}else if(empName == ""){ }else if(empName == ""){
$scope.alertMsg = "Employee Name is mandatory"; $scope.alertMsg = "Employee Name is mandatory";
document.getElementById('empName').focus(); document.getElementById('empName').focus();
}else if(mobileNumber == undefined || mobileNumber == ""){
$scope.alertMsg = "Mobile Number is mandatory";
document.getElementById('mobileNumber').focus();
}else if(empShift == undefined){ }else if(empShift == undefined){
$scope.alertMsg = "Please select a shift"; $scope.alertMsg = "Please select a primary skill";
document.getElementById('empShift').focus(); document.getElementById('empShift').focus();
}else{ }else{
$scope.alertMsg = ""; $scope.alertMsg = "";
var record = {"employeeId":$scope.empId, "employeeName": $scope.empName, "emailId": $scope.empEmail, "role": "Employee", "shift": $scope.empShift}; var record = {"employeeId":$scope.empId, "employeeName": $scope.empName, "emailId": $scope.empEmail, "role": "Employee", "shift": "Shift 1(09:00 AM - 06:00 PM)","mobileNumber":$scope.mobileNumber,"baseTechnology": $scope.empShift};
addEmployee(record); addEmployee(record);
} }
}; };
...@@ -214,14 +238,18 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window ...@@ -214,14 +238,18 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
menuItems.push({"menu" : "Manage Projects","icon" : "fa fa-tasks fa-2x","path" : "templates/projects.html"}); menuItems.push({"menu" : "Manage Projects","icon" : "fa fa-tasks fa-2x","path" : "templates/projects.html"});
menuItems.push({"menu" : "Attendance Report","icon" : "fa fa-bar-chart fa-2x","path" : "templates/attendanceReport.html"}); 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" : "Shift Details","icon" : "fa fa-superpowers fa-2x","path" : "templates/shiftdetails.html"});
menuItems.push({"menu" : "ReSync Data","icon" : "fa fa-recycle fa-2x","path" : "templates/resyncData.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-card-o fa-2x","path" : "templates/profile.html"});
}else if(role == "Manager"){ }else if(role == "Manager"){
menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"}); menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"});
menuItems.push({"menu" : "Reportee Details","icon" : "fa fa-users fa-2x","path" : "templates/reportees.html"}); menuItems.push({"menu" : "Reportee Details","icon" : "fa fa-users fa-2x","path" : "templates/reportees.html"});
menuItems.push({"menu" : "Manage Team","icon" : "fa fa-sitemap fa-2x","path" : "templates/projectDetails.html"}); menuItems.push({"menu" : "Manage Team","icon" : "fa fa-sitemap fa-2x","path" : "templates/projectDetails.html"});
menuItems.push({"menu" : "View Projects","icon" : "fa fa-compass fa-2x","path" : "templates/viewProjects.html"}); menuItems.push({"menu" : "View Projects","icon" : "fa fa-tasks fa-2x","path" : "templates/viewProjects.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-card-o fa-2x","path" : "templates/profile.html"});
}else if(role == "Employee"){ }else if(role == "Employee"){
menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"}); menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"});
menuItems.push({"menu" : "My Team","icon" : "fa fa-futbol-o fa-2x","path" : "templates/myTeam.html"}); menuItems.push({"menu" : "My Team","icon" : "fa fa-futbol-o fa-2x","path" : "templates/myTeam.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-card-o fa-2x","path" : "templates/profile.html"});
}else if(role == "HR Manager" || role == "Director"){ }else if(role == "HR Manager" || role == "Director"){
menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"}); menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"});
menuItems.push({"menu" : "Employee Details","icon" : "fa fa-users fa-2x","path" : "templates/employees.html"}); menuItems.push({"menu" : "Employee Details","icon" : "fa fa-users fa-2x","path" : "templates/employees.html"});
...@@ -231,10 +259,12 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window ...@@ -231,10 +259,12 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
menuItems.push({"menu" : "Manage Projects","icon" : "fa fa-tasks fa-2x","path" : "templates/projects.html"}); menuItems.push({"menu" : "Manage Projects","icon" : "fa fa-tasks fa-2x","path" : "templates/projects.html"});
menuItems.push({"menu" : "Attendance Report","icon" : "fa fa-bar-chart fa-2x","path" : "templates/attendanceReport.html"}); 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" : "Shift Details","icon" : "fa fa-superpowers fa-2x","path" : "templates/shiftdetails.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-card-o fa-2x","path" : "templates/profile.html"});
}else if(role == "Lead"){ }else if(role == "Lead"){
menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"}); menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"});
menuItems.push({"menu" : "Reportee Details","icon" : "fa fa-users fa-2x","path" : "templates/reportees.html"}); menuItems.push({"menu" : "Reportee Details","icon" : "fa fa-users fa-2x","path" : "templates/reportees.html"});
menuItems.push({"menu" : "Manage Team","icon" : "fa fa-sitemap fa-2x","path" : "templates/projectDetails.html"}); menuItems.push({"menu" : "Manage Team","icon" : "fa fa-sitemap fa-2x","path" : "templates/projectDetails.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-card-o fa-2x","path" : "templates/profile.html"});
} }
myFactory.setMenuItems(menuItems); myFactory.setMenuItems(menuItems);
......
myApp.controller("profileController", function($scope, $http, myFactory, $mdDialog, appConfig) {
$scope.records = [];
$scope.empId = myFactory.getEmpId();
$scope.empName = myFactory.getEmpName();
$scope.empEmailId = myFactory.getEmpEmailId();
$scope.getProfileData = function(){
var empId = $scope.empId;
$http({
method : "GET",
url : appConfig.appUri + "user/getEmployeeRoleData?empId=" + empId
}).then(function mySuccess(response) {
$scope.profile = response.data;
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
});
}
$scope.refreshPage = function(){
$scope.getProfileData();
};
$scope.updateProfile = function(){
$('#home').addClass('md-scroll-mask');
$mdDialog.show({
controller: UpdateProfileController,
templateUrl: 'templates/updateProfile.html',
parent: angular.element(document.body),
clickOutsideToClose:true,
locals:{dataToPass: $scope.profile},
})
.then(function(result) {
if(result == "Success") showAlert('Profile updated successfully');
else if(result == "Error") showAlert('Profile updation failed!!!');
$scope.refreshPage();
});
};
function UpdateProfileController($scope, $mdDialog, dataToPass) {
$scope.profile = dataToPass;
$scope.technologies=myFactory.getTechnologies();
$scope.baseTechnology=(dataToPass.baseTechnology == null ? undefined: dataToPass.baseTechnology);
$scope.mobileNumber=dataToPass.mobileNumber;
$scope.alternateMobileNumber=dataToPass.alternateMobileNumber;
$scope.personalEmailId=dataToPass.personalEmailId;
$scope.technologyKnown=dataToPass.technologyKnown;
$scope.cancel = function() {
$mdDialog.hide();
};
$scope.getSelectedTech = function(){
if ($scope.baseTechnology !== undefined) {
return $scope.baseTechnology;
} else {
return "Please select primary skill";
}
};
$scope.validateFields = function(){
var mobileNumber = $scope.mobileNumber;
$scope.alertMsg = "";
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";
var req = {
method : 'POST',
url : urlRequest,
headers : {
"Content-type" : "application/json"
},
data : record
}
$http(req).then(function mySuccess(response) {
$mdDialog.hide('Success');
$scope.dataToPass=response.data;
}, function myError(response){
$mdDialog.hide('Error');
});
};
}
function showAlert(message) {
$mdDialog.show($mdDialog.alert().parent(
angular.element(document.querySelector('#popupContainer')))
.clickOutsideToClose(true).textContent(message).ariaLabel(
'Alert Dialog').ok('Ok'));
}
});
...@@ -157,6 +157,7 @@ myApp.controller("projectMyTeamController",function($scope, myFactory, $mdDialog ...@@ -157,6 +157,7 @@ myApp.controller("projectMyTeamController",function($scope, myFactory, $mdDialog
} }
$scope.assignRole = function(action, userData){ $scope.assignRole = function(action, userData){
$('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
$mdDialog.show({ $mdDialog.show({
controller: AddRoleController, controller: AddRoleController,
...@@ -173,6 +174,7 @@ myApp.controller("projectMyTeamController",function($scope, myFactory, $mdDialog ...@@ -173,6 +174,7 @@ myApp.controller("projectMyTeamController",function($scope, myFactory, $mdDialog
}); });
}; };
$scope.updateEmployee = function(action, userData){ $scope.updateEmployee = function(action, userData){
$('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
$mdDialog.show({ $mdDialog.show({
controller: AddRoleController, controller: AddRoleController,
...@@ -193,7 +195,9 @@ myApp.controller("projectMyTeamController",function($scope, myFactory, $mdDialog ...@@ -193,7 +195,9 @@ myApp.controller("projectMyTeamController",function($scope, myFactory, $mdDialog
}; };
$scope.deleteRole = function(row){ $scope.deleteRole = function(row){
$('#home').addClass('md-scroll-mask');
var confirm = $mdDialog.confirm() var confirm = $mdDialog.confirm()
.clickOutsideToClose(true)
.textContent('Are you sure want to delete the role?') .textContent('Are you sure want to delete the role?')
.ok('Ok') .ok('Ok')
.cancel('Cancel'); .cancel('Cancel');
......
...@@ -134,6 +134,7 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial ...@@ -134,6 +134,7 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
} }
function showProgressDialog(){ function showProgressDialog(){
$('#home').addClass('md-scroll-mask');
$mdDialog.show({ $mdDialog.show({
templateUrl: 'templates/progressDialog.html', templateUrl: 'templates/progressDialog.html',
controller: ProgressController, controller: ProgressController,
...@@ -189,6 +190,7 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial ...@@ -189,6 +190,7 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
} }
$scope.sendEmail = function(ev){ $scope.sendEmail = function(ev){
$('#home').addClass('md-scroll-mask');
parentData.toEmail = []; parentData.toEmail = [];
parentData.ccEmail = []; parentData.ccEmail = [];
$mdDialog.show({ $mdDialog.show({
......
myApp.controller("resyncDataController",function($scope, myFactory, $mdDialog, appConfig, $http, $timeout){
// Date picker related code
var today = new Date();
$scope.maxDate = today;
$scope.searchDate = today;
$scope.setSearchDate = function(dateValue){
$scope.searchDate = dateValue;
};
$scope.resyncData = function(){
showProgressDialog("Performing data resync!!! Please wait...");
var searchDate = getFormattedDate($scope.searchDate);
$http({
method : "POST",
url : appConfig.appUri + "attendance/employeesDataSave/" + searchDate
}).then(function mySuccess(response) {
$mdDialog.hide();
if(response.data == true){
$timeout(function(){showAlert('Data resync successful.');},600);
}else{
$timeout(function(){showAlert('Data resync failed.');},600);
}
}, function myError(response) {
showAlert("Something went wrong while data resync!!!");
});
};
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);
}
function showAlert(message) {
$mdDialog.show($mdDialog.alert().parent(
angular.element(document.querySelector('#popupContainer')))
.clickOutsideToClose(true).textContent(message).ariaLabel(
'Alert Dialog').ok('Ok'));
}
function showProgressDialog(msg){
$mdDialog.show({
templateUrl: 'templates/progressDialog.html',
controller: ProgressController,
parent: angular.element(document.body),
clickOutsideToClose:false,
locals: {dataToPass:msg}
});
}
function ProgressController($scope, dataToPass) {
$scope.progressText = dataToPass;
}
});
\ No newline at end of file
...@@ -131,6 +131,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid ...@@ -131,6 +131,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
} }
$scope.addProject = function(action, userData){ $scope.addProject = function(action, userData){
$('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
$mdDialog.show({ $mdDialog.show({
controller: AddProjectController, controller: AddProjectController,
...@@ -147,6 +148,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid ...@@ -147,6 +148,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
}); });
}; };
$scope.viewTeamDetails = function(action, userData){ $scope.viewTeamDetails = function(action, userData){
$('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
$mdDialog.show({ $mdDialog.show({
controller: AddProjectController, controller: AddProjectController,
...@@ -163,6 +165,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid ...@@ -163,6 +165,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
}); });
}; };
$scope.getUnAssignedEmployees = function(action, userData){ $scope.getUnAssignedEmployees = function(action, userData){
$('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
$mdDialog.show({ $mdDialog.show({
controller: AddProjectController, controller: AddProjectController,
...@@ -179,6 +182,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid ...@@ -179,6 +182,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
}); });
}; };
$scope.getAllocatedEmployees = function(action, userData){ $scope.getAllocatedEmployees = function(action, userData){
$('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
$mdDialog.show({ $mdDialog.show({
controller: AddProjectController, controller: AddProjectController,
...@@ -199,7 +203,9 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid ...@@ -199,7 +203,9 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
}; };
$scope.deleteRole = function(row){ $scope.deleteRole = function(row){
$('#home').addClass('md-scroll-mask');
var confirm = $mdDialog.confirm() var confirm = $mdDialog.confirm()
.clickOutsideToClose(true)
.textContent('Are you sure you want to delete this project?') .textContent('Are you sure you want to delete this project?')
.ok('Ok') .ok('Ok')
.cancel('Cancel'); .cancel('Cancel');
...@@ -242,7 +248,8 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid ...@@ -242,7 +248,8 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
$scope.isDisabled = false; $scope.isDisabled = false;
$scope.result = ""; $scope.result = "";
$scope.managerDetails = managers; $scope.managerDetails = managers;
$scope.prjctStses=["Active","On Hold","Proposed","Completed"]; $scope.prjctStses=["Active","Completed","On Hold","Proposed"];
if(dataToPass.action == "Assign"){ if(dataToPass.action == "Assign"){
$scope.projectId = ""; $scope.projectId = "";
$scope.projectName = ""; $scope.projectName = "";
......
...@@ -30,7 +30,9 @@ myApp.factory('myFactory', function() { ...@@ -30,7 +30,9 @@ myApp.factory('myFactory', function() {
var templateUrl = ""; var templateUrl = "";
var profileUrl = ""; var profileUrl = "";
var designations=""; var designations="";
var technologies="";
var shifts=""; var shifts="";
var accounts="";
function setEmpId(id) { function setEmpId(id) {
empId = id; empId = id;
} }
...@@ -74,6 +76,21 @@ myApp.factory('myFactory', function() { ...@@ -74,6 +76,21 @@ myApp.factory('myFactory', function() {
function getDesignations() { function getDesignations() {
return designations; return designations;
} }
function setAccounts(accounts1) {
accounts = accounts1;
}
function getAccounts() {
return accounts;
}
function setTechnologies(technologies1) {
technologies = technologies1;
}
function getTechnologies() {
return technologies;
}
function setShifts(shifts1) { function setShifts(shifts1) {
shifts = shifts1; shifts = shifts1;
} }
...@@ -110,6 +127,10 @@ myApp.factory('myFactory', function() { ...@@ -110,6 +127,10 @@ myApp.factory('myFactory', function() {
getMenuItems : getMenuItems, getMenuItems : getMenuItems,
setDesignations : setDesignations, setDesignations : setDesignations,
getDesignations : getDesignations, getDesignations : getDesignations,
setAccounts : setAccounts,
getAccounts : getAccounts,
setTechnologies : setTechnologies,
getTechnologies : getTechnologies,
setShifts : setShifts, setShifts : setShifts,
getShifts : getShifts, getShifts : getShifts,
setTemplateUrl : setTemplateUrl, setTemplateUrl : setTemplateUrl,
......
app.factory('exportUiGridService', exportUiGridService);
exportUiGridService.inject = ['uiGridExporterService'];
function exportUiGridService(uiGridExporterService) {
var service = {
exportToExcel: exportToExcel
};
return service;
function Workbook() {
if (!(this instanceof Workbook)) return new Workbook();
this.SheetNames = [];
this.Sheets = {};
}
function exportToExcel(sheetName, gridApi, rowTypes, colTypes) {
var columns = gridApi.grid.options.showHeader ? uiGridExporterService.getColumnHeaders(gridApi.grid, colTypes) : [];
var data = uiGridExporterService.getData(gridApi.grid, rowTypes, colTypes);
var fileName = gridApi.grid.options.exporterExcelFilename ? gridApi.grid.options.exporterExcelFilename : 'dokuman';
fileName += '.xlsx';
var wb = new Workbook(),
ws = sheetFromArrayUiGrid(data, columns);
wb.SheetNames.push(sheetName);
wb.Sheets[sheetName] = ws;
var wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: true,
type: 'binary'
});
saveAs(new Blob([s2ab(wbout)], {
type: 'application/octet-stream'
}), fileName);
}
function sheetFromArrayUiGrid(data, columns) {
var ws = {};
var range = {
s: {
c: 10000000,
r: 10000000
},
e: {
c: 0,
r: 0
}
};
var C = 0;
columns.forEach(function (c) {
var v = c.displayName || c.value || columns[i].name;
addCell(range, v, 0, C, ws);
C++;
}, this);
var R = 1;
data.forEach(function (ds) {
C = 0;
ds.forEach(function (d) {
var v = d.value;
addCell(range, v, R, C, ws);
C++;
});
R++;
}, this);
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
return ws;
}
/**
*
* @param {*} data
* @param {*} columns
*/
function datenum(v, date1904) {
if (date1904) v += 1462;
var epoch = Date.parse(v);
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
}
function s2ab(s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
function addCell(range, value, row, col, ws) {
if (range.s.r > row) range.s.r = row;
if (range.s.c > col) range.s.c = col;
if (range.e.r < row) range.e.r = row;
if (range.e.c < col) range.e.c = col;
var cell = {
v: value
};
if (cell.v == null) cell.v = '-';
var cell_ref = XLSX.utils.encode_cell({
c: col,
r: row
});
if (typeof cell.v === 'number') cell.t = 'n';
else if (typeof cell.v === 'boolean') cell.t = 'b';
else if (cell.v instanceof Date) {
cell.t = 'n';
cell.z = XLSX.SSF._table[14];
cell.v = datenum(cell.v);
} else cell.t = 's';
ws[cell_ref] = cell;
}
}
\ No newline at end of file
<md-dialog aria-label="Role Template" style="width:400px;height:800px;"> <md-dialog aria-label="Role Template" style="width:400px;height:800px;" ng-init="getProjects()">
<form ng-cloak name="myForm"> <form ng-cloak name="myForm">
<md-toolbar> <md-toolbar>
<div class="md-toolbar-tools" style="background: cadetblue;"> <div class="md-toolbar-tools" style="background: cadetblue;">
......
...@@ -32,11 +32,6 @@ ...@@ -32,11 +32,6 @@
</div> </div>
<div class="row col-lg-12" style="height: 15px;"></div> <div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12"> <div class="row col-lg-12">
<div class="col-xs-2">
<p>
<b>Total Employees:</b> {{totalEmployees}}
</p>
</div>
<div class="col-xs-2"> <div class="col-xs-2">
<p> <p>
<b>Total Present:</b> {{totalPresent}} <b>Total Present:</b> {{totalPresent}}
...@@ -63,7 +58,7 @@ ...@@ -63,7 +58,7 @@
</div> </div>
</div> </div>
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-selection ui-grid-exporter <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-selection ui-grid-exporter
class="myGrid"> class="myGrid" style="width:99%;height:330px;">
<div class="watermark" ng-show="!gridOptions.data.length">No <div class="watermark" ng-show="!gridOptions.data.length">No
data available</div> data available</div>
</div> </div>
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<b>Average Login hours:&nbsp;&nbsp;</b> {{avgLoginHrs}} <b>Average Login hours:&nbsp;&nbsp;</b> {{avgLoginHrs}}
</p> </p>
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid"> class="myGrid" style="width:99%;height:370px;">
<div class="watermark" ng-show="!gridOptions.data.length">Search <div class="watermark" ng-show="!gridOptions.data.length">Search
by Employee ID</div> by Employee ID</div>
</div> </div>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<meta name="author" content=""></meta> <meta name="author" content=""></meta>
<base href="/myTime/"></base> <base href="/myTime/"></base>
<title>My Time</title> <title>My Time</title>
<link rel="icon" type="image/png" href="images/favicon.png">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-cookies.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-cookies.js"></script>
...@@ -28,7 +29,6 @@ ...@@ -28,7 +29,6 @@
<link rel="stylesheet" href="css/default-styles.css"></link> <link rel="stylesheet" href="css/default-styles.css"></link>
<script src="js/bootstrap.min.js"></script> <script src="js/bootstrap.min.js"></script>
<script src="http://ui-grid.info/release/ui-grid.js"></script> <script src="http://ui-grid.info/release/ui-grid.js"></script>
<!-- <script src="http://ui-grid.info/docs/grunt-scripts/csv.js"></script> -->
<script src="http://ui-grid.info/docs/grunt-scripts/pdfmake.js"></script> <script src="http://ui-grid.info/docs/grunt-scripts/pdfmake.js"></script>
<script src="http://ui-grid.info/docs/grunt-scripts/vfs_fonts.js"></script> <script src="http://ui-grid.info/docs/grunt-scripts/vfs_fonts.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.9.12/xlsx.full.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.9.12/xlsx.full.min.js"></script>
...@@ -53,7 +53,8 @@ ...@@ -53,7 +53,8 @@
<script src="controllers/AttendanceReportController.js"></script> <script src="controllers/AttendanceReportController.js"></script>
<script src="controllers/ShiftDetailsController.js"></script> <script src="controllers/ShiftDetailsController.js"></script>
<script src="controllers/ViewProjectController.js"></script> <script src="controllers/ViewProjectController.js"></script>
<script src="controllers/MyProfileController.js"></script>
<script src="controllers/ResyncDataController.js"></script>
</head> </head>
<body> <body>
<ng-include src="'templates/login.html'" id="home"></ng-include> <ng-include src="'templates/login.html'" id="home"></ng-include>
......
...@@ -18,34 +18,16 @@ ...@@ -18,34 +18,16 @@
<div class="row col-lg-12" style="height: 15px;"></div> <div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12"> <div class="row col-lg-12">
<div class="col-lg-1" style="float: left;padding-left:20px;"> <div class="col-lg-1" style="float: left;padding-left:20px;">
<!-- <div class="input-group" style="box-shadow: 1px 1px 1px 1px rgba(0,0,0,.26);">
<input type="text" ng-model="empSearchId" id="empSearchId"
ng-blur="validateEmpId()" class="form-control"
placeholder="Employee ID" style="width:120px;border-radius:0px;">
<span class="input-group-btn">
<button class="btn btn-secondary" type="button"
ng-click="getEmployeeRole()" style="border: 1px solid #ccc;border-radius:0px;">
<i class="fa fa-search fa-2x" style="font-size: 1.3em;"
aria-hidden="true"></i>
</button>
</span>
</div> -->
</div> </div>
<div class="col-lg-1" <div class="col-lg-1"
style="cursor: pointer; float: right; right: 75px;"> style="cursor: pointer; float: right; right: 75px;">
<!-- <md-button class="md-raised md-primary"
style="width:142px;background: cadetblue;"
ng-click="assignRole('Assign', parentData)"> <i
class="fa fa-plus-circle fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left"></i> Assign
Employee</md-button> -->
</div> </div>
</div> </div>
<div class="row col-lg-12" style="height: 15px;"></div> <div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12" style="margin-left: 0px;"> <div class="row col-lg-12" style="padding-top: 4%;margin-left:0px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid"> class="myGrid" style="width:99%;height:370px;margin-left:0px;">
<div class="watermark" ng-show="!gridOptions.data.length">No <div class="watermark" ng-show="!gridOptions.data.length">No
data available</div> data available</div>
</div> </div>
......
<md-dialog aria-label="Role Template" style="width:520px;height:440px;"> <md-dialog aria-label="Role Template" style="width:520px;height:450px;">
<form ng-cloak name="myForm"> <form ng-cloak name="myForm">
<md-toolbar> <md-toolbar>
<div class="md-toolbar-tools" <div class="md-toolbar-tools"
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
<div class="md-dialog-content"> <div class="md-dialog-content">
<div class="form-group"> <div class="form-group">
<input type="text" class="form-control" id="projectId" name="projectId" <input type="text" class="form-control" id="projectId" name="projectId"
ng-model="projectId" placeholder="Project Id" ng-blur="" ng-disabled="isDisabled"/> <br> ng-model="projectId" placeholder="Project Id Auto Generated" ng-blur="" ng-disabled="true"/> <br>
<input type="text" class="form-control" id="projectName" name="projectName" <input type="text" class="form-control" id="projectName" name="projectName"
ng-model="projectName" placeholder="Project Name" /><br> 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()" > <md-select ng-model="managerModel" md-selected-text="getManagers()" >
<md-optgroup label="managers"> <md-option ng-value="manager" <md-optgroup label="managers"> <md-option ng-value="manager"
ng-repeat="manager in managerDetails">{{manager.employeeName}}</md-option> </md-optgroup> </md-select> ng-repeat="manager in managerDetails">{{manager.employeeName}}</md-option> </md-optgroup> </md-select>
......
<md-dialog aria-label="Role Template" style="width:520px;height:440px;"> <md-dialog aria-label="Role Template" style="width:520px;height:390px;">
<form ng-cloak name="myForm"> <form ng-cloak name="myForm">
<md-toolbar> <md-toolbar>
<div class="md-toolbar-tools" <div class="md-toolbar-tools"
......
<md-dialog aria-label="Role Template" style="width:520px;height:440px;"> <md-dialog aria-label="Role Template" style="width:520px;height:440px;" ng-init="getProjects()">
<form ng-cloak name="myForm"> <form ng-cloak name="myForm">
<md-toolbar> <md-toolbar>
<div class="md-toolbar-tools" <div class="md-toolbar-tools"
style="background: cadetblue;"> style="background: cadetblue;">
<h2>{{templateTitle}} Employee </h2> <h2>{{templateTitle}} Team Mate </h2>
<span flex></span> <span flex></span>
<md-button class="md-icon-button" ng-click="cancel()"> <i <md-button class="md-icon-button" ng-click="cancel()"> <i
class="fa fa-times fa-2x" class="fa fa-times fa-2x"
......
<div class="md-padding" style="width: 100%; padding: 3px 0px 0px 0px;"
id="popupContainer" ng-controller="profileController"
ng-init="getProfileData()">
<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;">My
Profile</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 class="clearfix"></div>
</div>
</div>
<br />
<div class="row col-lg-12" style="padding-top:5%">
<div class="container col-lg-8" style="float: left; padding-left: 100px;">
<div class="row col-lg-12">
<div class="col-xs-4" style="text-align: left;">
<p>
<b>Employee ID:</b>
</p>
</div>
<div class="col-xs-6">
<p>
<b>:</b> {{profile.employeeId}}
</p>
</div>
</div>
<div class="row col-lg-12">
<div class="col-xs-4">
<p>
<b>Employee Name</b>
</p>
</div>
<div class="col-xs-6">
<p>
<b>:</b> {{profile.employeeName}}
</p>
</div>
</div>
<div class="row col-lg-12">
<div class="col-xs-4">
<p>
<b>Email ID</b>
</p>
</div>
<div class="col-xs-6">
<p>
<b>:</b> {{profile.emailId}}
</p>
</div>
</div>
<div class="row col-lg-12">
<div class="col-xs-4">
<p>
<b>Role</b>
</p>
</div>
<div class="col-xs-6">
<p>
<b>:</b> {{profile.role}}
</p>
</div>
</div>
<div class="row col-lg-12">
<div class="col-xs-4">
<p>
<b>Mobile Number:</b>
</p>
</div>
<div class="col-xs-6">
<p>
<b>:</b> {{profile.mobileNumber}}
</p>
</div>
</div>
<div class="row col-lg-12">
<div class="col-xs-4">
<p>
<b>Alt Mobile Number</b>
</p>
</div>
<div class="col-xs-6">
<p>
<b>:</b> {{profile.alternateMobileNumber}}
</p>
</div>
</div>
<div class="row col-lg-12">
<div class="col-xs-4">
<p>
<b>Personal EmailId</b>
</p>
</div>
<div class="col-xs-6">
<p>
<b>:</b> {{profile.personalEmailId}}
</p>
</div>
</div>
<div class="row col-lg-12">
<div class="col-xs-4">
<p>
<b>Shift</b>
</p>
</div>
<div class="col-xs-6">
<p>
<b>:</b> {{profile.shift}}
</p>
</div>
</div>
<div class="row col-lg-12">
<div class="col-xs-4">
<p>
<b>Primary Skill</b>
</p>
</div>
<div class="col-xs-6">
<p>
<b>:</b> {{profile.baseTechnology}}
</p>
</div>
</div>
<div class="row col-lg-12">
<div class="col-xs-4">
<p>
<b>Technologies Known</b>
</p>
</div>
<div class="col-xs-6">
<p>
<b>:</b> {{profile.technologyKnown}}
</p>
</div>
</div>
<div class="row col-lg-12" style="height: 15px;"></div>
</div>
<div class="col-lg-2"
style="cursor: pointer; float: left; ">
<md-button class="md-raised md-primary"
style="width:142px;background: cadetblue;"
ng-click="updateProfile()"> <i
class="fa fa-pencil-square-o fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left"></i> Update
Profile</md-button>
</div>
</div>
</div>
\ No newline at end of file
<div class="md-padding" style="width: 100%; padding: 3px 0px 0px 0px;" <div class="md-padding" style="width: 100%; padding: 3px 0px 0px 0px;"
id="popupContainer" ng-controller="projectTeamController" id="popupContainer" ng-controller="projectTeamController"
ng-init="getUserRoles();getEmployeesToTeam();getProjects();"> ng-init="getUserRoles();getEmployeesToTeam();">
<div class="container-fluid mainDivHeaderClass"> <div class="container-fluid mainDivHeaderClass">
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
...@@ -18,34 +18,21 @@ ...@@ -18,34 +18,21 @@
<div class="row col-lg-12" style="height: 15px;"></div> <div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12"> <div class="row col-lg-12">
<div class="col-lg-1" style="float: left;padding-left:20px;"> <div class="col-lg-1" style="float: left;padding-left:20px;">
<!-- <div class="input-group" style="box-shadow: 1px 1px 1px 1px rgba(0,0,0,.26);">
<input type="text" ng-model="empSearchId" id="empSearchId"
ng-blur="validateEmpId()" class="form-control"
placeholder="Employee ID" style="width:120px;border-radius:0px;">
<span class="input-group-btn">
<button class="btn btn-secondary" type="button"
ng-click="getEmployeeRole()" style="border: 1px solid #ccc;border-radius:0px;">
<i class="fa fa-search fa-2x" style="font-size: 1.3em;"
aria-hidden="true"></i>
</button>
</span>
</div> -->
</div> </div>
<div class="col-lg-1" <div class="col-lg-1"
style="cursor: pointer; float: right; right: 75px;"> style="cursor: pointer; float: right; right: 75px;">
<md-button class="md-raised md-primary" <md-button class="md-raised md-primary"
style="width:142px;background: cadetblue;" style="width:142px;background: cadetblue;"
ng-click="assignRole('Assign', parentData)"> <i ng-click="assignRole('Add', parentData)"> <i
class="fa fa-plus-circle fa-2x" class="fa fa-plus-circle fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left"></i> Assign style="margin-top: 5px; font-size: 1.5em; float: left"></i> Add Team Mate</md-button>
Employee</md-button>
</div> </div>
</div> </div>
<div class="row col-lg-12" style="height: 15px;"></div> <div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12" style="margin-left: 0px;"> <div class="row col-lg-12" style="margin-left: 0px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid"> class="myGrid" style="width:99%;height:380px;">
<div class="watermark" ng-show="!gridOptions.data.length">No <div class="watermark" ng-show="!gridOptions.data.length">No
data available</div> data available</div>
</div> </div>
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<div class="row col-lg-12" style="margin-left: 0px;"> <div class="row col-lg-12" style="margin-left: 0px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid"> class="myGrid" style="width:99%;height:370px;margin-left:0px;">
<div class="watermark" ng-show="!gridOptions.data.length">No <div class="watermark" ng-show="!gridOptions.data.length">No
data available</div> data available</div>
</div> </div>
......
<md-dialog aria-label="Registration Template" style="width:440px;height:380px;"> <md-dialog aria-label="Registration Template" style="width:440px;height:500px;">
<form ng-cloak name="myForm"> <form ng-cloak name="myForm">
<md-toolbar style="height:40px"> <md-toolbar style="height:40px">
<div class="md-toolbar-tools" <div class="md-toolbar-tools"
...@@ -19,9 +19,11 @@ ...@@ -19,9 +19,11 @@
<input type="text" class="form-control" id="empName" name="empName" <input type="text" class="form-control" id="empName" name="empName"
ng-model="empName" placeholder="Employee Name" /><br> ng-model="empName" placeholder="Employee Name" /><br>
<input type="text" class="form-control" id="empEmail" name="empEmail" <input type="text" class="form-control" id="empEmail" name="empEmail"
ng-model="empEmail" placeholder="Email ID" ng-disabled="true"/> ng-model="empEmail" placeholder="Email ID" ng-disabled="true"/><br>
<input type="text" class="form-control" id="mobileNumber" name="mobileNumber"
ng-model="mobileNumber" placeholder="Mobile No" />
<md-select ng-model="empShift" md-selected-text="getSelectedShift()" id="empShift"> <md-select ng-model="empShift" md-selected-text="getSelectedShift()" id="empShift">
<md-optgroup label="shifts"> <md-option ng-value="shift" <md-optgroup label="skills"> <md-option ng-value="shift"
ng-repeat="shift in shifts">{{shift}}</md-option> </md-optgroup> </md-select> ng-repeat="shift in shifts">{{shift}}</md-option> </md-optgroup> </md-select>
<div role="alert"> <div role="alert">
<span class="error" style="color: red;">{{alertMsg}}</span> <span class="error" style="color: red;">{{alertMsg}}</span>
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<b>Average Login hours:&nbsp;&nbsp;</b> {{avgLoginHrs}} <b>Average Login hours:&nbsp;&nbsp;</b> {{avgLoginHrs}}
</p> </p>
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid"> class="myGrid" style="width:99%;height:370px;">
<div class="watermark" ng-show="!gridOptions.data.length">Search <div class="watermark" ng-show="!gridOptions.data.length">Search
by Employee ID</div> by Employee ID</div>
</div> </div>
......
<div class="md-padding" style="width: 100%; padding: 3px 0px 0px 0px; text-align:center;"
id="popupContainer" ng-controller="resyncDataController">
<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;">Resync Data</p>
</div>
<div class="clearfix"></div>
</div>
</div>
<br />
<div class="container" style="top:25%;left:35%;position:fixed;">
<div class="row col-lg-12">
<div class="col-xs-4">
<p>
<b>Select Date:</b>
<md-datepicker ng-model="searchDate" md-placeholder="Enter date"
md-max-date="maxDate"
onkeydown="return false" ng-change="setSearchDate(searchDate)"></md-datepicker>
</p>
</div>
<div class="col-xs-2" style="cursor: pointer;" align="right">
<md-button class="md-raised md-primary"
style="width:100px;background: cadetblue;" ng-click="resyncData()">
<i class="fa fa-retweet fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left"></i> Resync</md-button>
</div>
</div>
</div>
</div>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<div class="row col-lg-12" style="margin-left: 0px;"> <div class="row col-lg-12" style="margin-left: 0px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid"> class="myGrid" style="width:99%;height:370px;margin-left:0px;">
<div class="watermark" ng-show="!gridOptions.data.length">No <div class="watermark" ng-show="!gridOptions.data.length">No
data available</div> data available</div>
</div> </div>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<div class="row col-lg-12" style="margin-left: 0px;"> <div class="row col-lg-12" style="margin-left: 0px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-selection ui-grid-exporter <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-selection ui-grid-exporter
class="myGrid"> class="myGrid" style="width:99%;height:350px;margin-left:0px;">
<div class="watermark" ng-show="!gridOptions.data.length">No <div class="watermark" ng-show="!gridOptions.data.length">No
data available</div> data available</div>
</div> </div>
......
<md-dialog aria-label="Role Template" style="width:400px;height:550px;">
<form ng-cloak name="myForm">
<md-toolbar>
<div class="md-toolbar-tools"
style="background: cadetblue;">
<h2>Update Profile </h2>
<span flex></span>
<md-button class="md-icon-button" ng-click="cancel()"> <i
class="fa fa-times fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left"></i> </md-button>
</div>
</md-toolbar>
<md-dialog-content>
<div class="md-dialog-content">
<div class="form-group">
<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"
ng-model="alternateMobileNumber" placeholder="Alternate Mobile Number" /> <br>
<input type="text" class="form-control" id="personalEmailId" name="personalEmailId"
ng-model="personalEmailId" placeholder="Personal EmailId" /> <br>
<md-select ng-model="baseTechnology" md-selected-text="getSelectedTech()" id="baseTechnology" >
<md-optgroup label="skills"> <md-option ng-value="tech"
ng-repeat="tech in technologies">{{tech}}</md-option> </md-optgroup> </md-select>
<textarea rows="4" cols="10" class="form-control" id="technologyKnown" name="technologyKnown"
ng-model="technologyKnown" placeholder="Technologies Known" /> <br>
<div role="alert">
<span class="error" style="color: red;">{{alertMsg}}</span>
</div>
</div>
</md-dialog-content>
<md-dialog-actions layout="row"> <md-button
class="md-raised" data-ng-click="validateFields()" style="width:120px;background: cadetblue;color:white;">
Update </md-button> <md-button class="md-raised" ng-click="cancel()" style="width:120px;background: cadetblue;color:white;">
Cancel </md-button> </md-dialog-actions>
</form>
</md-dialog>
...@@ -27,18 +27,13 @@ ...@@ -27,18 +27,13 @@
<div class="col-lg-2" <div class="col-lg-2"
style="cursor: pointer; float: right; right: 75px;"> style="cursor: pointer; float: right; right: 75px;">
<!-- <md-button class="md-raised md-primary"
style="width:182px;background: cadetblue;"
ng-click="getAllocatedEmployees('allocated', parentData)"> <i
class="fa fa-product-hunt fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left"></i>Project Allocations</md-button> -->
</div> </div>
</div> </div>
<div class="row col-lg-12" style="height: 15px;"></div> <div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12" style="margin-left: 0px;"> <div class="row col-lg-12" style="margin-left: 0px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid"> class="myGrid" style="width:99%;height:370px;">
<div class="watermark" ng-show="!gridOptions.data.length">No <div class="watermark" ng-show="!gridOptions.data.length">No
data available</div> data available</div>
</div> </div>
......
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