Skip to content

Commit

Permalink
Major Commit: Updated the classes with the new Java8 DateTime.
Browse files Browse the repository at this point in the history
  • Loading branch information
mahi-mullapudi committed May 17, 2018
1 parent 825c690 commit 393f459
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/tutorialq/entities/ClientDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@Entity
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/tutorialq/entities/DocumentRefData.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.Set;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/tutorialq/entities/DocumentUpload.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@Entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@Entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

Expand Down Expand Up @@ -57,10 +58,10 @@ public void approveTimesheet(long timesheetId, String reviewerName, String revie
log.info("Inside approveTimesheet method of TimesheetServiceImpl, timesheetId :: " + timesheetId);
Timesheet timesheetObj = timesheetRepository.findById(timesheetId).get();
timesheetObj.setTimesheetStatus(ApplicationConstants.TIMESHEET_STATUS_APPROVED);
timesheetObj.setDateApproved(LocalDate.now());
timesheetObj.setDateApproved(LocalDateTime.now());
timesheetObj.setNameApproved(reviewerName);
timesheetObj.setReviewerComments(reviewComments);
timesheetObj.setDateLastModified(LocalDate.now());
timesheetObj.setDateLastModified(LocalDateTime.now());
timesheetObj.setNameLastModified(reviewerName);
//Updating the Timesheet object with necessary information.
timesheetRepository.save(timesheetObj);
Expand All @@ -75,7 +76,7 @@ public void rejectTimesheet(long timesheetId, String reviewerName, String review
timesheetObj.setDateApproved(null);
timesheetObj.setNameApproved("");
timesheetObj.setReviewerComments(reviewComments);
timesheetObj.setDateLastModified(LocalDate.now());
timesheetObj.setDateLastModified(LocalDateTime.now());
timesheetObj.setNameLastModified(reviewerName);
//Updating the Timesheet object with necessary information.
timesheetRepository.save(timesheetObj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import javax.servlet.http.HttpSession;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Map;

@Controller
Expand Down Expand Up @@ -68,7 +69,7 @@ public String submitEmployeeDetails(@ModelAttribute("employeeDetails") Employee

log.info("The form has no errors, so persisting the data.");
try {
employeeDetails.setDateLastModified(LocalDate.now());
employeeDetails.setDateLastModified(LocalDateTime.now());
employeeDetails.setNameLastModified(employeeDetails.getEmployeeFullName());
log.info("Saving the registration details of the Employee.");
registrationService.saveRegistrationDetails(employeeDetails);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import javax.servlet.http.HttpSession;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Map;
import java.util.TreeMap;

Expand Down Expand Up @@ -87,7 +88,7 @@ public ModelAndView submitRegistration(@ModelAttribute("employee") Employee empl
log.info("The form has no errors, so persisting the data.");
try {
employeeRegistration.setAccountStatusFlag(ApplicationConstants.REGISTRATION_STATUS_ACTIVE);
employeeRegistration.setDateCreated(LocalDate.now());
employeeRegistration.setDateCreated(LocalDateTime.now());
employeeRegistration.setNameCreated(employeeRegistration.getEmployeeFullName());
log.info("Saving the registration details of the Employee.");
registrationService.saveRegistrationDetails(employeeRegistration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import javax.servlet.http.HttpSession;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -99,7 +99,7 @@ public ModelAndView addTimesheet(@ModelAttribute("timesheetObj") Timesheet times
timesheetObj.setTimesheetType(ApplicationConstants.TIMESHEET_TYPE_WEEKLY);
timesheetObj.setNameCreated(employee.getEmployeeFullName());
timesheetObj.setEmployee(employee);
timesheetObj.setDateCreated(LocalDate.now());
timesheetObj.setDateCreated(LocalDateTime.now());

timesheetValidator.validate(timesheetObj, result);
//Check if the Add Time sheet form information has errors.
Expand Down

0 comments on commit 393f459

Please sign in to comment.