|
|
@ -56,104 +56,121 @@ public class NulmController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("/updateStaff") |
|
|
@GetMapping("/updateStaff") |
|
|
public String viewUpdateScreen( |
|
|
|
|
|
@RequestParam(value = "department", required = false) String department, |
|
|
|
|
|
@RequestParam(value = "division", required = false) String division, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
public String viewUpdateScreen( |
|
|
|
|
|
@RequestParam(value = "department", required = false) String department, |
|
|
|
|
|
@RequestParam(value = "division", required = false) String division, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
// Fetch the full list or filtered list based on parameters |
|
|
|
|
|
List<Map<String, Object>> enrollments = nulmService.getEnrollments(department, null); |
|
|
|
|
|
|
|
|
// Fetch the full list or filtered list based on parameters |
|
|
|
|
|
List<Map<String, Object>> enrollments = nulmService.getEnrollments(department, null); |
|
|
|
|
|
|
|
|
// Add the list to the model to be accessed in the view |
|
|
|
|
|
model.addAttribute("enrollments", enrollments); |
|
|
|
|
|
model.addAttribute("selectedDepartment", department); // Pass the selected department |
|
|
|
|
|
|
|
|
// Add the list to the model to be accessed in the view |
|
|
|
|
|
model.addAttribute("enrollments", enrollments); |
|
|
|
|
|
model.addAttribute("selectedDepartment", department); // Pass the selected department |
|
|
|
|
|
|
|
|
// Return the view name |
|
|
|
|
|
return "modules/nulm/updated-staff"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Return the view name |
|
|
|
|
|
return "modules/nulm/updated-staff"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("/salaryDetails") |
|
|
@GetMapping("/salaryDetails") |
|
|
public String getSalaryDetails( |
|
|
public String getSalaryDetails( |
|
|
@RequestParam(value = "month", required = false) String month, |
|
|
|
|
|
@RequestParam(value = "year", required = false) Integer year, // Use Integer instead of int |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> salaryDetails = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
// Check if month and year are provided |
|
|
|
|
|
if (month != null && year != null) { |
|
|
|
|
|
salaryDetails = nulmService.getAttendanceWithSalary(month, year); |
|
|
|
|
|
} else { |
|
|
|
|
|
// Handle case when no month or year is provided |
|
|
|
|
|
model.addAttribute("message", "Please select a month and year."); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
model.addAttribute("salaryCounts", salaryDetails); |
|
|
|
|
|
System.out.println("salarydetails for month: " + month + ", year: " + year); |
|
|
|
|
|
return "modules/nulm/salary-details"; |
|
|
|
|
|
|
|
|
@RequestParam(value = "month", required = false) String month, |
|
|
|
|
|
@RequestParam(value = "year", required = false) Integer year, // Use Integer instead of int |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> salaryDetails = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
// Check if month and year are provided |
|
|
|
|
|
if (month != null && year != null) { |
|
|
|
|
|
salaryDetails = nulmService.getAttendanceWithSalary(month, year); |
|
|
|
|
|
} else { |
|
|
|
|
|
// Handle case when no month or year is provided |
|
|
|
|
|
model.addAttribute("message", "Please select a month and year."); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
model.addAttribute("salaryCounts", salaryDetails); |
|
|
|
|
|
System.out.println("salarydetails for month: " + month + ", year: " + year); |
|
|
|
|
|
return "modules/nulm/salary-details"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
|
|
|
* @GetMapping("/salary-approve") |
|
|
|
|
|
* public String viewSalaryApproveScreen(@RequestParam(required = false) String |
|
|
|
|
|
* month, |
|
|
|
|
|
* |
|
|
|
|
|
* @RequestParam(required = false) Integer year, |
|
|
|
|
|
* |
|
|
|
|
|
* @RequestParam(required = false) String salaryStatus, |
|
|
|
|
|
* Model model) { |
|
|
|
|
|
* List<Map<String, Object>> salaryInitiatedCounts; |
|
|
|
|
|
* |
|
|
|
|
|
* // If both month and year are provided, fetch the data; otherwise, return an |
|
|
|
|
|
* empty list |
|
|
|
|
|
* if (month != null && year != null) { |
|
|
|
|
|
* salaryInitiatedCounts = nulmService.getFilteredSalaryDetails(month, year, |
|
|
|
|
|
* salaryStatus); |
|
|
|
|
|
* } else { |
|
|
|
|
|
* salaryInitiatedCounts = Collections.emptyList(); // Empty list if no month |
|
|
|
|
|
* and year are provided |
|
|
|
|
|
* } |
|
|
|
|
|
* |
|
|
|
|
|
* model.addAttribute("salaryInitiatedCounts", salaryInitiatedCounts); |
|
|
|
|
|
* return "modules/nulm/salary-approve"; |
|
|
|
|
|
* } |
|
|
|
|
|
*/ |
|
|
@GetMapping("/salary-approve") |
|
|
@GetMapping("/salary-approve") |
|
|
public String viewSalaryApproveScreen(@RequestParam(required = false) String month, |
|
|
public String viewSalaryApproveScreen(@RequestParam(required = false) String month, |
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String salaryStatus, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
List<Map<String, Object>> salaryInitiatedCounts; |
|
|
|
|
|
|
|
|
|
|
|
// If both month and year are provided, fetch the data; otherwise, return an empty list |
|
|
|
|
|
if (month != null && year != null) { |
|
|
|
|
|
salaryInitiatedCounts = nulmService.getFilteredSalaryDetails(month, year, salaryStatus); |
|
|
|
|
|
} else { |
|
|
|
|
|
salaryInitiatedCounts = Collections.emptyList(); // Empty list if no month and year are provided |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
model.addAttribute("salaryInitiatedCounts", salaryInitiatedCounts); |
|
|
|
|
|
return "modules/nulm/salary-approve"; |
|
|
|
|
|
} |
|
|
|
|
|
*/ |
|
|
|
|
|
@GetMapping("/salary-approve") |
|
|
|
|
|
public String viewSalaryApproveScreen(@RequestParam(required = false) String month, |
|
|
|
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String salaryStatus, // Added department parameter |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String salaryStatus, // Added department parameter |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
|
|
|
|
|
System.out.println("LoginUserId=="+LoginUserId); |
|
|
|
|
|
|
|
|
System.out.println("LoginUserId==" + LoginUserId); |
|
|
|
|
|
|
|
|
List<Map<String, Object>> salaryInitiatedCounts; |
|
|
List<Map<String, Object>> salaryInitiatedCounts; |
|
|
|
|
|
|
|
|
// Fetch data if both month and year are provided, otherwise return an empty list |
|
|
|
|
|
if (month != null && year != null) { |
|
|
|
|
|
salaryInitiatedCounts = nulmService.getFilteredSalaryDetails(month, year, salaryStatus,LoginUserId); // Pass department to the service method |
|
|
|
|
|
} else { |
|
|
|
|
|
salaryInitiatedCounts = Collections.emptyList(); // Empty list if no month and year are provided |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Fetch data if both month and year are provided, otherwise return an empty |
|
|
|
|
|
// list |
|
|
|
|
|
if (month != null && year != null) { |
|
|
|
|
|
salaryInitiatedCounts = nulmService.getFilteredSalaryDetails(month, year, salaryStatus, LoginUserId); // Pass |
|
|
|
|
|
// department |
|
|
|
|
|
// to |
|
|
|
|
|
// the |
|
|
|
|
|
// service |
|
|
|
|
|
// method |
|
|
|
|
|
} else { |
|
|
|
|
|
salaryInitiatedCounts = Collections.emptyList(); // Empty list if no month and year are provided |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
model.addAttribute("salaryInitiatedCounts", salaryInitiatedCounts); |
|
|
|
|
|
|
|
|
model.addAttribute("salaryInitiatedCounts", salaryInitiatedCounts); |
|
|
|
|
|
|
|
|
return "modules/nulm/salary-approve"; |
|
|
|
|
|
|
|
|
return "modules/nulm/salary-approve"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// |
|
|
//// |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/salary-approve-park") |
|
|
@GetMapping("/salary-approve-park") |
|
|
public String viewSalaryApproveScreen_park(@RequestParam(required = false) String month, |
|
|
public String viewSalaryApproveScreen_park(@RequestParam(required = false) String month, |
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String salaryStatus, // Added department parameter |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String salaryStatus, // Added department parameter |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
|
|
|
|
|
List<Map<String, Object>> salaryInitiatedCounts; |
|
|
List<Map<String, Object>> salaryInitiatedCounts; |
|
|
|
|
|
|
|
|
// Fetch data if both month and year are provided, otherwise return an empty list |
|
|
|
|
|
|
|
|
// Fetch data if both month and year are provided, otherwise return an empty |
|
|
|
|
|
// list |
|
|
if (month != null && year != null) { |
|
|
if (month != null && year != null) { |
|
|
salaryInitiatedCounts = nulmService.getFilteredSalaryDetails_park(month, year, salaryStatus,LoginUserId); // Pass department to the service method |
|
|
|
|
|
|
|
|
salaryInitiatedCounts = nulmService.getFilteredSalaryDetails_park(month, year, salaryStatus, LoginUserId); // Pass |
|
|
|
|
|
// department |
|
|
|
|
|
// to |
|
|
|
|
|
// the |
|
|
|
|
|
// service |
|
|
|
|
|
// method |
|
|
} else { |
|
|
} else { |
|
|
salaryInitiatedCounts = Collections.emptyList(); // Empty list if no month and year are provided |
|
|
salaryInitiatedCounts = Collections.emptyList(); // Empty list if no month and year are provided |
|
|
} |
|
|
} |
|
|
@ -163,184 +180,201 @@ public class NulmController { |
|
|
return "modules/nulm/salary-approve-park"; |
|
|
return "modules/nulm/salary-approve-park"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// |
|
|
//// |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/salary-report") |
|
|
@GetMapping("/salary-report") |
|
|
public String viewSalaryReport( |
|
|
public String viewSalaryReport( |
|
|
@RequestParam(required = false) String month, |
|
|
|
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String salaryStatus, |
|
|
|
|
|
@RequestParam(required = false) String groupName, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
@RequestParam(required = false) String month, |
|
|
|
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String salaryStatus, |
|
|
|
|
|
@RequestParam(required = false) String groupName, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
|
|
|
|
|
// Initialize an empty salaryReport list |
|
|
|
|
|
List<Map<String, Object>> salaryReport = new ArrayList<>(); |
|
|
|
|
|
|
|
|
// Initialize an empty salaryReport list |
|
|
|
|
|
List<Map<String, Object>> salaryReport = new ArrayList<>(); |
|
|
|
|
|
|
|
|
// Only fetch the report if month and year are provided |
|
|
|
|
|
if (month != null && year != null) { |
|
|
|
|
|
salaryReport = nulmService.getSalaryReport(month, year, salaryStatus, groupName, LoginUserId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Only fetch the report if month and year are provided |
|
|
|
|
|
if (month != null && year != null) { |
|
|
|
|
|
salaryReport = nulmService.getSalaryReport(month, year, salaryStatus, groupName, LoginUserId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Add the fetched data to the model |
|
|
|
|
|
model.addAttribute("salaryReport", salaryReport); |
|
|
|
|
|
|
|
|
// Add the fetched data to the model |
|
|
|
|
|
model.addAttribute("salaryReport", salaryReport); |
|
|
|
|
|
|
|
|
return "modules/nulm/salary-report"; // Returns the view 'salary-report' |
|
|
|
|
|
|
|
|
return "modules/nulm/salary-report"; // Returns the view 'salary-report' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//// |
|
|
//// |
|
|
|
|
|
|
|
|
@GetMapping("/salary-report-park") |
|
|
@GetMapping("/salary-report-park") |
|
|
public String viewSalaryReport_Park( |
|
|
public String viewSalaryReport_Park( |
|
|
@RequestParam(required = false) String month, |
|
|
|
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String salaryStatus, |
|
|
|
|
|
@RequestParam(required = false) String groupName, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
@RequestParam(required = false) String month, |
|
|
|
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String salaryStatus, |
|
|
|
|
|
@RequestParam(required = false) String groupName, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
|
|
model.addAttribute("LoginUserId",LoginUserId); |
|
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
|
|
|
|
|
// Initialize an empty salaryReport list |
|
|
|
|
|
List<Map<String, Object>> salaryReport = new ArrayList<>(); |
|
|
|
|
|
|
|
|
// Initialize an empty salaryReport list |
|
|
|
|
|
List<Map<String, Object>> salaryReport = new ArrayList<>(); |
|
|
|
|
|
|
|
|
// Only fetch the report if month and year are provided |
|
|
|
|
|
if (month != null && year != null) { |
|
|
|
|
|
salaryReport = nulmService.getSalaryReport_park(month, year, salaryStatus, groupName, LoginUserId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Only fetch the report if month and year are provided |
|
|
|
|
|
if (month != null && year != null) { |
|
|
|
|
|
salaryReport = nulmService.getSalaryReport_park(month, year, salaryStatus, groupName, LoginUserId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Add the fetched data to the model |
|
|
|
|
|
model.addAttribute("salaryReport", salaryReport); |
|
|
|
|
|
|
|
|
// Add the fetched data to the model |
|
|
|
|
|
model.addAttribute("salaryReport", salaryReport); |
|
|
|
|
|
|
|
|
return "modules/nulm/salary-report-park"; // Returns the view 'salary-report' |
|
|
|
|
|
|
|
|
return "modules/nulm/salary-report-park"; // Returns the view 'salary-report' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//// |
|
|
//// |
|
|
|
|
|
|
|
|
@GetMapping("/salary-zonereport") |
|
|
@GetMapping("/salary-zonereport") |
|
|
public String viewZoneWiseReport( |
|
|
public String viewZoneWiseReport( |
|
|
@RequestParam(required = false) String month, |
|
|
|
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String salaryStatus, |
|
|
|
|
|
@RequestParam(required = false) String groupName, |
|
|
|
|
|
@RequestParam(required = false) String zone, |
|
|
|
|
|
@RequestParam(required = false) String division, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
//System.out.println("Zone: "+zone); |
|
|
|
|
|
|
|
|
|
|
|
// Initialize an empty salaryReport list |
|
|
|
|
|
List<Map<String, Object>> zoneWiseReport = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
// Only fetch the report if month, year and zone are provided |
|
|
|
|
|
if (month != null && year != null && zone!= null) { |
|
|
|
|
|
zoneWiseReport = nulmService.getZoneWiseReport(month, year, salaryStatus ,groupName, zone, division); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Add the fetched data to the model |
|
|
|
|
|
model.addAttribute("zonewiseReport", zoneWiseReport); |
|
|
|
|
|
|
|
|
|
|
|
return "modules/nulm/zone-wise-report"; // Returns the view 'salary-zonereport' |
|
|
|
|
|
|
|
|
@RequestParam(required = false) String month, |
|
|
|
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String salaryStatus, |
|
|
|
|
|
@RequestParam(required = false) String groupName, |
|
|
|
|
|
@RequestParam(required = false) String zone, |
|
|
|
|
|
@RequestParam(required = false) String division, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
// System.out.println("Zone: "+zone); |
|
|
|
|
|
|
|
|
|
|
|
// Initialize an empty salaryReport list |
|
|
|
|
|
List<Map<String, Object>> zoneWiseReport = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
// Only fetch the report if month, year and zone are provided |
|
|
|
|
|
if (month != null && year != null && zone != null) { |
|
|
|
|
|
zoneWiseReport = nulmService.getZoneWiseReport(month, year, salaryStatus, groupName, zone, division); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Add the fetched data to the model |
|
|
|
|
|
model.addAttribute("zonewiseReport", zoneWiseReport); |
|
|
|
|
|
|
|
|
|
|
|
return "modules/nulm/zone-wise-report"; // Returns the view 'salary-zonereport' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("/attendance-report") |
|
|
@GetMapping("/attendance-report") |
|
|
public String viewAttendanceReport( |
|
|
public String viewAttendanceReport( |
|
|
@RequestParam(required = false) String fromdate, |
|
|
|
|
|
@RequestParam(required = false) String todate, |
|
|
|
|
|
@RequestParam(required = false) String groupName, |
|
|
|
|
|
@RequestParam(required = false) String zone, |
|
|
|
|
|
@RequestParam(required = false) String division, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
@RequestParam(required = false) String fromdate, |
|
|
|
|
|
@RequestParam(required = false) String todate, |
|
|
|
|
|
@RequestParam(required = false) String groupName, |
|
|
|
|
|
@RequestParam(required = false) String zone, |
|
|
|
|
|
@RequestParam(required = false) String division, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
|
|
|
// Initialize an empty salaryReport list |
|
|
|
|
|
List<Map<String, Object>> attendanceReport = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
// Only fetch the report if month, year and zone are provided |
|
|
|
|
|
if (division != null && zone != null) { |
|
|
|
|
|
attendanceReport = nulmService.getAttendanceReport(fromdate, todate, groupName, zone, division); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Add the fetched data to the model |
|
|
|
|
|
model.addAttribute("attendanceReport", attendanceReport); |
|
|
|
|
|
|
|
|
// Initialize an empty salaryReport list |
|
|
|
|
|
List<Map<String, Object>> attendanceReport = new ArrayList<>(); |
|
|
|
|
|
|
|
|
return "modules/nulm/attendance-report"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Only fetch the report if month, year and zone are provided |
|
|
|
|
|
if (division != null && zone!= null) { |
|
|
|
|
|
attendanceReport = nulmService.getAttendanceReport(fromdate ,todate ,groupName, zone, division); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("/consolidated-attendance-report") // need to add |
|
|
|
|
|
public String viewConsolidatedAttendanceReport( |
|
|
|
|
|
@RequestParam(required = false) String fromdate, |
|
|
|
|
|
@RequestParam(required = false) String todate, |
|
|
|
|
|
@RequestParam(required = false) String groupName, |
|
|
|
|
|
@RequestParam(required = false) String zone, |
|
|
|
|
|
@RequestParam(required = false) String division, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
|
|
|
// Initialize an empty salaryReport list |
|
|
|
|
|
List<Map<String, Object>> consolidatedAttendanceReport = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
// Only fetch the report if month, year and zone are provided |
|
|
|
|
|
if (division != null && zone != null) { |
|
|
|
|
|
consolidatedAttendanceReport = nulmService.getConsolidatedAttendanceReport(fromdate, todate, groupName, |
|
|
|
|
|
zone, division); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Add the fetched data to the model |
|
|
|
|
|
model.addAttribute("attendanceReport", attendanceReport); |
|
|
|
|
|
|
|
|
// Add the fetched data to the model |
|
|
|
|
|
model.addAttribute("consolidatedAttendanceReport", consolidatedAttendanceReport); |
|
|
|
|
|
model.addAttribute("fromdate", fromdate); |
|
|
|
|
|
model.addAttribute("todate", todate); |
|
|
|
|
|
|
|
|
return "modules/nulm/attendance-report"; |
|
|
|
|
|
|
|
|
return "modules/nulm/attendance-report"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("/consolidated-attendance-report") // need to add |
|
|
|
|
|
public String viewConsolidatedAttendanceReport( |
|
|
|
|
|
@RequestParam(required = false) String fromdate, |
|
|
|
|
|
@RequestParam(required = false) String todate, |
|
|
|
|
|
@RequestParam(required = false) String groupName, |
|
|
|
|
|
@RequestParam(required = false) String zone, |
|
|
|
|
|
@RequestParam(required = false) String division, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
@GetMapping("/attendance-dates") // need to add |
|
|
|
|
|
public ResponseEntity<Map<String, List<String>>> getAttendanceDates( |
|
|
|
|
|
@RequestParam(required = false) String enrollmentId, |
|
|
|
|
|
@RequestParam(required = false) String fromdate, |
|
|
|
|
|
@RequestParam(required = false) String todate, |
|
|
|
|
|
@RequestParam(required = false) String type, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
// Initialize an empty salaryReport list |
|
|
|
|
|
List<Map<String, Object>> consolidatedAttendanceReport = new ArrayList<>(); |
|
|
|
|
|
|
|
|
return ResponseEntity.ok(nulmService.fetchAttendanceDates(enrollmentId, fromdate, todate, type)); |
|
|
|
|
|
|
|
|
// Only fetch the report if month, year and zone are provided |
|
|
|
|
|
if (division != null && zone != null) { |
|
|
|
|
|
consolidatedAttendanceReport = nulmService.getConsolidatedAttendanceReport(fromdate, todate, groupName, zone, division); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Add the fetched data to the model |
|
|
|
|
|
model.addAttribute("consolidatedAttendanceReport", consolidatedAttendanceReport); |
|
|
|
|
|
model.addAttribute("fromdate", fromdate); |
|
|
|
|
|
model.addAttribute("todate", todate); |
|
|
|
|
|
|
|
|
@GetMapping("/self-help-group") // need to add |
|
|
|
|
|
public String viewSelfHelpGroup(Model model) { |
|
|
|
|
|
|
|
|
return "modules/nulm/attendance-report"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Fetch the full list or filtered list based on parameters |
|
|
|
|
|
List<Map<String, Object>> selfHelpGroup = nulmService.getSelfHelpGroupDetails(); |
|
|
|
|
|
|
|
|
@GetMapping("/attendance-dates") //need to add |
|
|
|
|
|
public ResponseEntity<Map<String, List<String>>> getAttendanceDates( |
|
|
|
|
|
@RequestParam(required = false) String enrollmentId, |
|
|
|
|
|
@RequestParam(required = false) String fromdate, |
|
|
|
|
|
@RequestParam(required = false) String todate, |
|
|
|
|
|
@RequestParam(required = false) String type, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
|
|
|
// Add the list to the model to be accessed in the view |
|
|
|
|
|
model.addAttribute("selfHelpGroup", selfHelpGroup); |
|
|
|
|
|
|
|
|
return ResponseEntity.ok(nulmService.fetchAttendanceDates(enrollmentId, fromdate, todate, type)); |
|
|
|
|
|
|
|
|
// Return the view name |
|
|
|
|
|
return "modules/nulm/selfHelpGroup"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("/salary-nonInitiated") |
|
|
|
|
|
public String viewSalaryNotInitiatedReport( |
|
|
|
|
|
@RequestParam(required = false) String month, |
|
|
|
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String groupName, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
System.out.println(" salary-nonInitiated groupname====" + groupName); |
|
|
|
|
|
if (groupName != null && !groupName.isEmpty()) { |
|
|
|
|
|
groupName = URLDecoder.decode(groupName, StandardCharsets.UTF_8); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> salaryNotInitiatedReport = new ArrayList<>(); |
|
|
|
|
|
|
|
|
@GetMapping("/self-help-group") // need to add |
|
|
|
|
|
public String viewSelfHelpGroup(Model model) { |
|
|
|
|
|
|
|
|
if (month != null && year != null) { |
|
|
|
|
|
salaryNotInitiatedReport = nulmService.getSalaryNotInitiatedReport(month, year, groupName); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Fetch the full list or filtered list based on parameters |
|
|
|
|
|
List<Map<String, Object>> selfHelpGroup = nulmService.getSelfHelpGroupDetails(); |
|
|
|
|
|
|
|
|
model.addAttribute("salaryNonInitiatedReport", salaryNotInitiatedReport); |
|
|
|
|
|
|
|
|
// Add the list to the model to be accessed in the view |
|
|
|
|
|
model.addAttribute("selfHelpGroup", selfHelpGroup); |
|
|
|
|
|
|
|
|
return "modules/nulm/salary-nonInitiatedreport"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/staffupdate") |
|
|
|
|
|
public String viewSalaryReport(Model model) { |
|
|
|
|
|
|
|
|
// Return the view name |
|
|
|
|
|
return "modules/nulm/selfHelpGroup"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|
|
|
|
|
System.out.println("===" + LoginUserId); |
|
|
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
|
|
|
|
|
|
|
|
boolean hasAccess = nulmService.hasStaffUpdateAccess(LoginUserId); |
|
|
|
|
|
|
|
|
@GetMapping("/salary-nonInitiated") |
|
|
|
|
|
public String viewSalaryNotInitiatedReport( |
|
|
|
|
|
@RequestParam(required = false) String month, |
|
|
|
|
|
@RequestParam(required = false) Integer year, |
|
|
|
|
|
@RequestParam(required = false) String groupName, |
|
|
|
|
|
Model model) { |
|
|
|
|
|
System.out.println(" salary-nonInitiated groupname====" + groupName); |
|
|
|
|
|
if (groupName != null && !groupName.isEmpty()) { |
|
|
|
|
|
groupName = URLDecoder.decode(groupName, StandardCharsets.UTF_8); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (hasAccess) { |
|
|
|
|
|
|
|
|
List<Map<String, Object>> salaryNotInitiatedReport = new ArrayList<>(); |
|
|
|
|
|
|
|
|
model.addAttribute("LoginUserId", LoginUserId); |
|
|
|
|
|
return "modules/nulm/staffupdate"; |
|
|
|
|
|
|
|
|
if (month != null && year != null) { |
|
|
|
|
|
salaryNotInitiatedReport = nulmService.getSalaryNotInitiatedReport(month, year, groupName); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
model.addAttribute("salaryNonInitiatedReport", salaryNotInitiatedReport); |
|
|
|
|
|
|
|
|
return "modules/nulm/staffupdatenoacess"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return "modules/nulm/salary-nonInitiatedreport"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |