From 846ad9879dd15252de6170c4b27420a980099a4e Mon Sep 17 00:00:00 2001 From: Mahidhar Mullapudi Date: Thu, 17 May 2018 20:42:11 -0400 Subject: [PATCH] Major Commit: Updated the Client Details and Immigration details information and moved the UI pages to respective folders. - Created new files for Top Navbar and SideNavbar. --- .../entities/ImmigrationDetails.java | 6 +- .../EmployeeDetailsController.java | 28 +- .../TimesheetRestController.java | 3 +- src/main/webapp/WEB-INF/jsp/clientDetails.jsp | 365 ----------------- .../webapp/WEB-INF/jsp/immigrationDetails.jsp | 216 ---------- src/main/webapp/WEB-INF/jsp/sideNavbar.jsp | 27 ++ .../WEB-INF/jsp/staff/clientDetails.jsp | 368 ++++++++++++++++++ .../WEB-INF/jsp/staff/dashboard-staff.jsp | 1 - .../WEB-INF/jsp/staff/immigrationDetails.jsp | 200 ++++++++++ src/main/webapp/WEB-INF/jsp/topNavbar.jsp | 32 ++ 10 files changed, 647 insertions(+), 599 deletions(-) delete mode 100644 src/main/webapp/WEB-INF/jsp/clientDetails.jsp delete mode 100644 src/main/webapp/WEB-INF/jsp/immigrationDetails.jsp create mode 100644 src/main/webapp/WEB-INF/jsp/sideNavbar.jsp create mode 100644 src/main/webapp/WEB-INF/jsp/staff/clientDetails.jsp create mode 100644 src/main/webapp/WEB-INF/jsp/staff/immigrationDetails.jsp create mode 100644 src/main/webapp/WEB-INF/jsp/topNavbar.jsp diff --git a/src/main/java/com/tutorialq/entities/ImmigrationDetails.java b/src/main/java/com/tutorialq/entities/ImmigrationDetails.java index ebb2f79..41f9758 100644 --- a/src/main/java/com/tutorialq/entities/ImmigrationDetails.java +++ b/src/main/java/com/tutorialq/entities/ImmigrationDetails.java @@ -1,7 +1,10 @@ package com.tutorialq.entities; import com.fasterxml.jackson.annotation.JsonIgnore; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.*; @@ -12,7 +15,6 @@ @Data @Entity -@EqualsAndHashCode(exclude = {"employee", "immiDetailsId"}) @NoArgsConstructor @AllArgsConstructor @ToString diff --git a/src/main/java/com/tutorialq/web/controllers/EmployeeDetailsController.java b/src/main/java/com/tutorialq/web/controllers/EmployeeDetailsController.java index 7232666..abfc58f 100644 --- a/src/main/java/com/tutorialq/web/controllers/EmployeeDetailsController.java +++ b/src/main/java/com/tutorialq/web/controllers/EmployeeDetailsController.java @@ -21,7 +21,6 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.support.SessionStatus; -import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import javax.servlet.http.HttpSession; @@ -47,12 +46,13 @@ public class EmployeeDetailsController { @GetMapping("/employeeDetails") - public ModelAndView getEmployeeDetails(@RequestParam("empId") long empId, - Model model, HttpSession session) throws Exception { + public String getEmployeeDetails(@RequestParam("empId") long empId, + Model model, HttpSession session, RedirectAttributes redirectAttributes) throws Exception { log.info("Inside getEmployeeDetails method of EmployeeDetails Controller:: empId: " + empId); Employee employeeDetails = employeeService.getEmployeeByEmployeeId(empId); + model.addAttribute("employeeDetails", employeeDetails); //Initiating ModelAndView object with the Employee object - return new ModelAndView("employeeDetails", "employeeDetails", employeeDetails); + return "staff/employeeDetails"; } @PostMapping("/employeeDetails") @@ -63,7 +63,7 @@ public String submitEmployeeDetails(@ModelAttribute("employeeDetails") Employee if (result.hasErrors()) { model.addAttribute("css", "danger"); model.addAttribute("msg", "Invalid / Missing Information. Please correct the information entered below!!"); - return "employeeDetails"; + return "staff/employeeDetails"; } log.info("The form has no errors, so persisting the data."); @@ -82,7 +82,7 @@ public String submitEmployeeDetails(@ModelAttribute("employeeDetails") Employee model.addAttribute("css", "danger"); model.addAttribute("msg", "Technical issue while saving the Registration information. " + "Please contact Admin for more information!!"); - return "employeeDetails"; + return "staff/employeeDetails"; } log.info("Successfully Registered the user, forwarding to the Login page."); redirectAttributes.addFlashAttribute("msg", "You have successfully updated Employee Details."); @@ -93,12 +93,12 @@ public String submitEmployeeDetails(@ModelAttribute("employeeDetails") Employee @GetMapping("/clientDetails") public String getClientDetails(@RequestParam("empId") long empId, - Model model, HttpSession session) throws Exception { + Model model, HttpSession session, RedirectAttributes redirectAttributes) throws Exception { log.info("Inside getClientDetails method of EmployeeDetails Controller:: empId: " + empId); Employee employee = employeeService.getEmployeeByEmployeeId(empId); model.addAttribute("employeeDetails", employee); model.addAttribute("clientDetails", employeeService.getClientDetails(empId)); - return "clientDetails"; + return "staff/clientDetails"; } @PostMapping("/clientDetails") @@ -110,7 +110,7 @@ public String submitClientDetails( if (result.hasErrors()) { model.addAttribute("css", "danger"); model.addAttribute("msg", "Invalid / Missing Information. Please correct the information entered below!!"); - return "clientDetails"; + return "staff/clientDetails"; } try { log.info("Saving the registration details of the Employee."); @@ -132,11 +132,11 @@ public String submitClientDetails( @GetMapping("/immiDetails") public String getImmigrationDetails(@RequestParam("empId") long empId, - Model model, HttpSession session) throws Exception { + Model model, HttpSession session, RedirectAttributes redirectAttributes) throws Exception { log.info("Inside getImmigrationDetails method of EmployeeDetails Controller:: empId: " + empId); - Employee employee = employeeService.getEmployeeByEmployeeId(empId); - model.addAttribute("immigrationDetails", employee.getImmigrationDetails()); - return "immigrationDetails"; + ImmigrationDetails immigrationDetails = employeeService.getImmigrationDetails(empId); + model.addAttribute("immigrationDetails", immigrationDetails); + return "staff/immigrationDetails"; } @PostMapping("/immiDetails") @@ -148,7 +148,7 @@ public String submitImmigrationDetails( if (result.hasErrors()) { model.addAttribute("css", "danger"); model.addAttribute("msg", "Invalid / Missing Information. Please correct the information entered below!!"); - return "immigrationDetails"; + return "staff/immigrationDetails"; } try { log.info("Saving the immigration details of the Employee."); diff --git a/src/main/java/com/tutorialq/web/restControllers/TimesheetRestController.java b/src/main/java/com/tutorialq/web/restControllers/TimesheetRestController.java index 51d715c..141a4bc 100644 --- a/src/main/java/com/tutorialq/web/restControllers/TimesheetRestController.java +++ b/src/main/java/com/tutorialq/web/restControllers/TimesheetRestController.java @@ -217,7 +217,8 @@ public ResponseEntity approveTimesheet( */ @GetMapping("/rejectTimesheet") public ResponseEntity rejectTimesheet( - @RequestParam("timesheetId") long timesheetId, @RequestParam("reviewerName") String reviewerName, + @RequestParam("timesheetId") long timesheetId, + @RequestParam("reviewerName") String reviewerName, @RequestParam("reviewComments") String reviewComments) throws Exception { log.info("Inside rejectTimesheet method of TimesheetRestController:: timesheetId: " + timesheetId diff --git a/src/main/webapp/WEB-INF/jsp/clientDetails.jsp b/src/main/webapp/WEB-INF/jsp/clientDetails.jsp deleted file mode 100644 index 7930762..0000000 --- a/src/main/webapp/WEB-INF/jsp/clientDetails.jsp +++ /dev/null @@ -1,365 +0,0 @@ -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %> -<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - - - - - - - Employee Management-Client Details - - - - - - - - - - - -
-
-
-
-
- -
-

- Client Details -

-
- -
- -
-
- - - - - - -
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - - - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - - - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - - - -
-
-
- - -
- -
- - -
-
-
-
- - - -
-
- -
-
-
-
-
-
- - - - - - - - - - - \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/immigrationDetails.jsp b/src/main/webapp/WEB-INF/jsp/immigrationDetails.jsp deleted file mode 100644 index 71ee754..0000000 --- a/src/main/webapp/WEB-INF/jsp/immigrationDetails.jsp +++ /dev/null @@ -1,216 +0,0 @@ -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %> -<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - - - - - - - Employee Management App Registration - - - - - - - - - - - -
-
-
-
-
- -
-

- Immigration Details -

-
- -
- -
-
- - -
- - - - - - -
- -
- - - - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- - -
- -
- - -
-
-
- -
-
-
-
- - - -
- - -
-
-

Immigration Document Summary

- -
- - - - - - - - - - - - - - - - - - - - - - - -
Document IdDocument NameDocument TypeUploaded DateCommentsView
Document IdDocument NameDocument TypeUploaded DateCommentsView
-
- -
-
- - -
-
-
-
-
-
- - - - - - - - - - - \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/sideNavbar.jsp b/src/main/webapp/WEB-INF/jsp/sideNavbar.jsp new file mode 100644 index 0000000..effcb4c --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/sideNavbar.jsp @@ -0,0 +1,27 @@ + diff --git a/src/main/webapp/WEB-INF/jsp/staff/clientDetails.jsp b/src/main/webapp/WEB-INF/jsp/staff/clientDetails.jsp new file mode 100644 index 0000000..f17a60f --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/staff/clientDetails.jsp @@ -0,0 +1,368 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %> +<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + + + + Employee Management-Client Details + + + + + + + + + + + +
+
+ +
+ +
+
+
+
+
+
+

+ Client Details +

+
+ +
+ +
+
+ + + + + + +
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + + + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + + + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
+ + + + +
+
+
+ + +
+ +
+ + +
+
+
+
+ + + +
+
+ +
+
+
+
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/staff/dashboard-staff.jsp b/src/main/webapp/WEB-INF/jsp/staff/dashboard-staff.jsp index b735e2b..53f890f 100644 --- a/src/main/webapp/WEB-INF/jsp/staff/dashboard-staff.jsp +++ b/src/main/webapp/WEB-INF/jsp/staff/dashboard-staff.jsp @@ -30,7 +30,6 @@