Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…e_management

# Conflicts:
#	src/main/resources/static/js/employeeDetailsSummary.js
  • Loading branch information
Mahidhar C Mullapudi committed Sep 7, 2018
2 parents 14a276e + 0270d7e commit d6fc1c8
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 110 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/tutorialq/constants/QueryProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ public class QueryProperties {
+ " emp.employeeTitle = :employeeTitle, "
+ " emp.employeePhone = :employeePhone "
+ " WHERE emp.employeeId = :employeeId";

public final static String updatePassword = "UPDATE Employee emp "
+ " SET emp.empPassword = :password "
+ " WHERE emp.employeeEmailId = :emailId";
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface EmployeeRepository extends JpaRepository<Employee, Long> {
int countEmployeeByEmployeeEmailIdAndEmpPassword(String emailId, String password);

@Modifying
@Query("UPDATE Employee emp SET emp.empPassword = :password where emp.employeeEmailId = :emailId")
@Query(QueryProperties.updatePassword)
int updatePassword(@Param("password") String password, @Param("emailId") String emailId);

@Modifying
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface AuthenticationService {
* @return
* @throws Exception
*/
public boolean checkEmailIdExists(String emailId) throws Exception;
boolean checkEmailIdExists(String emailId) throws Exception;

/**
* Authenticates the user based on emailId and password entered in the Login page.
Expand All @@ -25,7 +25,7 @@ public interface AuthenticationService {
* @return
* @throws Exception
*/
public boolean authenticatedLogin(String emailId, String password) throws Exception;
boolean authenticatedLogin(String emailId, String password) throws Exception;

/**
* Get Employee details by EmailId.
Expand All @@ -34,5 +34,5 @@ public interface AuthenticationService {
* @return
* @throws Exception
*/
public Employee getEmployeeByEmailId(String emailId) throws Exception;
Employee getEmployeeByEmailId(String emailId) throws Exception;
}
15 changes: 7 additions & 8 deletions src/main/java/com/tutorialq/services/EmailService.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.tutorialq.services;

import java.util.List;
import java.util.Map;

import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
* Common Mail Service to send mails.
* <b><u>NOTE:</u></b>
Expand All @@ -27,7 +26,7 @@ public interface EmailService {
* @param subject String
* @param mailContent String
*/
public void sendPlainTextMailWithoutAttachment(String fromAddress, String toAddress, String ccAddress, String subject, String mailContent);
void sendPlainTextMailWithoutAttachment(String fromAddress, String toAddress, String ccAddress, String subject, String mailContent);

/**
* Service method to send plain text mail <b>WITH</b> multiple attachments.
Expand All @@ -41,7 +40,7 @@ public interface EmailService {
* For single files add it to list.
* Ex: Arrays.asList(uploadedFile)
*/
public void sendPlainTextMailWithAttachment(String fromAddress, String toAddress, String ccAddress, String subject, String mailContent, List<MultipartFile> attachFiles);
void sendPlainTextMailWithAttachment(String fromAddress, String toAddress, String ccAddress, String subject, String mailContent, List<MultipartFile> attachFiles);

/**
* Service method to send simple plain text mail to multiple recipients
Expand All @@ -53,7 +52,7 @@ public interface EmailService {
* @param subject String
* @param mailContent String of mail content.
*/
public void sendBulkPlainTextMailWithoutAttachment(String fromAddress, List<String> toAddress, List<String> ccAddress, String subject, String mailContent);
void sendBulkPlainTextMailWithoutAttachment(String fromAddress, List<String> toAddress, List<String> ccAddress, String subject, String mailContent);

/**
* Service method to send simple plain text mail to multiple recipients
Expand All @@ -68,7 +67,7 @@ public interface EmailService {
* For single files add it to list.
* Ex: Arrays.asList(uploadedFile)
*/
public void sendBulkPlainTextMailWithAttachment(String fromAddress, List<String> toAddress, List<String> ccAddress, String subject, String mailContent, List<MultipartFile> attachFiles);
void sendBulkPlainTextMailWithAttachment(String fromAddress, List<String> toAddress, List<String> ccAddress, String subject, String mailContent, List<MultipartFile> attachFiles);

/**
* @param fromAddress
Expand All @@ -78,6 +77,6 @@ public interface EmailService {
* @param mailContent
* @throws Exception
*/
public void sendMimeMailWithoutAttachment(String fromAddress, List<String> toAddress, List<String> ccAddress, String subject, String mailContent, boolean isMailHtml) throws Exception;
void sendMimeMailWithoutAttachment(String fromAddress, List<String> toAddress, List<String> ccAddress, String subject, String mailContent, boolean isMailHtml) throws Exception;
}

14 changes: 7 additions & 7 deletions src/main/java/com/tutorialq/services/TimesheetService.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public interface TimesheetService {
*
* @param timesheetObj
*/
public void save(Timesheet timesheetObj) throws Exception;
void save(Timesheet timesheetObj) throws Exception;

/**
* Returns the list of Timesheets for a given EmployeeId.
Expand All @@ -22,23 +22,23 @@ public interface TimesheetService {
* @return
* @throws Exception
*/
public List<Timesheet> getTimesheetsByEmpId(long employeeId) throws Exception;
List<Timesheet> getTimesheetsByEmpId(long employeeId) throws Exception;

/**
* Returns the Timesheet information from the Timesheet table based on the given timesheetId.
*
* @param timesheetId
* @return
*/
public Timesheet getTimesheetByTimesheetId(long timesheetId) throws Exception;
Timesheet getTimesheetByTimesheetId(long timesheetId) throws Exception;

/**
* Returns the Timesheet information from the Timesheet table based on the given Timesheet EndDate.
*
* @param endDate
* @return
*/
public Timesheet getTimesheetByEndDate(LocalDate endDate, Employee employee) throws Exception;
Timesheet getTimesheetByEndDate(LocalDate endDate, Employee employee) throws Exception;

/**
* Returns the list of Timesheets for a given From Date, To LocalDate and Timesheet Status.
Expand All @@ -49,7 +49,7 @@ public interface TimesheetService {
* @return
* @throws Exception
*/
public List<Timesheet> getTimesheetSummaryStaff(LocalDate fromDate, LocalDate toDate, String timesheetStatus) throws Exception;
List<Timesheet> getTimesheetSummaryStaff(LocalDate fromDate, LocalDate toDate, String timesheetStatus) throws Exception;

/**
* Approve the Timesheet based on the given TimesheetId and Reviewer Comments.
Expand All @@ -58,7 +58,7 @@ public interface TimesheetService {
* @param timesheetId
* @throws Exception
*/
public void approveTimesheet(long timesheetId, String reviewerName, String reviewerComments) throws Exception;
void approveTimesheet(long timesheetId, String reviewerName, String reviewerComments) throws Exception;

/**
* Reject the Timesheet based on the given TimesheetId and the reviewer comments.
Expand All @@ -67,6 +67,6 @@ public interface TimesheetService {
* @param timesheetId
* @throws Exception
*/
public void rejectTimesheet(long timesheetId, String reviewerName, String reviewerComments) throws Exception;
void rejectTimesheet(long timesheetId, String reviewerName, String reviewerComments) throws Exception;

}
5 changes: 3 additions & 2 deletions src/main/resources/static/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ $(document).ready(function () {
*/
function getTimesheetByEndDate(endDate) {
var employeeId = $('#employeeId').val();
console.log("Inside getTimesheetByEndDate method:: endDate: " + endDate + " employeeId: " + employeeId);
var endDateFormatted = moment(endDate).format("MM/DD/YYYY");
console.log("Inside getTimesheetByEndDate method:: endDate: " + endDateFormatted + " employeeId: " + employeeId);
$.ajax({
type: 'GET',
url: '/employeeManagement/api/getTimesheetByEndDate?endDate=' + endDate + "&employeeId=" + employeeId,
url: '/employeeManagement/api/getTimesheetByEndDate?endDate=' + endDateFormatted + "&employeeId=" + employeeId,
success: function (responsedata) {
console.log("Inside success function after getting the timesheet info.");
populateViewTimesheet(responsedata);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/js/employeeDetailsSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function fetchEmpDetails() {
{
data: 'employeeId',
mRender: function (data, type, row) {
var link = "<a href=\"/employeeManagement/employeeDetails?empId=" + data + "\" target=\"_blank\" class=\"btn btn-link\">View</a>";
var link = '<a class="btn-link" href="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/employeeManagement/employeeDetails?empId="' + data + '>View</a>';
return link;
}
}
Expand Down
Loading

0 comments on commit d6fc1c8

Please sign in to comment.