From dc313fb7dcaeff6ba511ad7b74b6f3600e52c15c Mon Sep 17 00:00:00 2001 From: Hariprasath S <113695067+Hariprasath4022@users.noreply.github.com> Date: Mon, 16 Mar 2026 19:53:17 +0530 Subject: [PATCH] Changes in NULM/Park and vtrack --- .../cdwaste/service/OfficerService.java | 98 +++- .../nulm/controller/NulmAPIController.java | 13 + .../nulm/controller/NulmController.java | 112 ++++ .../gccoffice/nulm/service/NulmService.java | 161 ++++- .../vtrack/service/VehicleService.java | 23 + .../modules/nulm/attendance-report-park.html | 552 ++++++++++++++++++ .../modules/nulm/attendance-report.html | 4 +- .../modules/nulm/updated-staff-park.html | 380 ++++++++++++ .../modules/nulm/zone-wise-report-park.html | 430 ++++++++++++++ 9 files changed, 1732 insertions(+), 41 deletions(-) create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/nulm/attendance-report-park.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/nulm/updated-staff-park.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/nulm/zone-wise-report-park.html diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/cdwaste/service/OfficerService.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/cdwaste/service/OfficerService.java index 92635389..60dcb54a 100644 --- a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/cdwaste/service/OfficerService.java +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/cdwaste/service/OfficerService.java @@ -77,40 +77,74 @@ public class OfficerService { +// public void sendWhatsappMessage(String refId, double actualWeight, double totalCharge, String mobileNumber) { +// try { +// String message = String.format( +// "Your request (Request ID: *%s*) has been processed. Please proceed with the payment.\n\nActual Weight: *%.0f kg*\nAmount Payable: *%.0f*", +// refId, actualWeight, totalCharge +// ); +// +// String encodedMessage = URLEncoder.encode(message, StandardCharsets.UTF_8); +// String encodedHeader = URLEncoder.encode("C&D Waste Collection – Payment Request", StandardCharsets.UTF_8); +// String encodedFooter = URLEncoder.encode("Greater Chennai Corporation", StandardCharsets.UTF_8); +// +// String redirectUrlParam = URLEncoder.encode("dumpregistration/paymentform?requestId=" + refId, StandardCharsets.UTF_8); +// +// String apiUrl = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507" + +// "&password=h2YjFNcJ" + +// "&send_to=" + mobileNumber + +// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE" + +// "&msg=" + encodedMessage + +// "&isTemplate=true" + +// "&header=" + encodedHeader + +// "&footer=" + encodedFooter + +// "&buttonUrlParam=" + redirectUrlParam; +// +// // Optional: log URL before hitting for debugging +// System.out.println("WhatsApp API URL: " + apiUrl); +// +// // Make API call +// // restTemplate.getForObject(apiUrl, String.class); +// smsService.sendMsg(apiUrl); +// } catch (Exception e) { +// e.printStackTrace(); +// // Optionally log or alert failure +// } +// } + + public void sendWhatsappMessage(String refId, double actualWeight, double totalCharge, String mobileNumber) { try { - String message = String.format( - "Your request (Request ID: *%s*) has been processed. Please proceed with the payment.\n\nActual Weight: *%.0f kg*\nAmount Payable: *%.0f*", - refId, actualWeight, totalCharge - ); - - String encodedMessage = URLEncoder.encode(message, StandardCharsets.UTF_8); - String encodedHeader = URLEncoder.encode("C&D Waste Collection – Payment Request", StandardCharsets.UTF_8); - String encodedFooter = URLEncoder.encode("Greater Chennai Corporation", StandardCharsets.UTF_8); - - String redirectUrlParam = URLEncoder.encode("dumpregistration/paymentform?requestId=" + refId, StandardCharsets.UTF_8); - - String apiUrl = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507" + - "&password=h2YjFNcJ" + - "&send_to=" + mobileNumber + - "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE" + - "&msg=" + encodedMessage + - "&isTemplate=true" + - "&header=" + encodedHeader + - "&footer=" + encodedFooter + - "&buttonUrlParam=" + redirectUrlParam; - - // Optional: log URL before hitting for debugging - System.out.println("WhatsApp API URL: " + apiUrl); - - // Make API call - // restTemplate.getForObject(apiUrl, String.class); - smsService.sendMsg(apiUrl); - } catch (Exception e) { - e.printStackTrace(); - // Optionally log or alert failure - } - } + + String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd"; + String from = "919445061913"; + String placeholders = ""; + String button_placeholder=""; + +// String apiUrl ="https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="+mobileNumber+"&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Thank+you%21+Your+request+has+been+successfully+submitted.%0ARequest+Id+%3A+"+refId+"&isTemplate=true&header=C%26D+Waste+Collection+Request+Registered&footer=Greater+Chennai+Corporation"; + +// placeholders = URLEncoder.encode(refId, "UTF-8"); + + placeholders = URLEncoder.encode(refId + "|~|" + actualWeight + "|~|" + totalCharge, "UTF-8"); + + button_placeholder=URLEncoder.encode(refId, "UTF-8"); + + String whatsappMsg = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=" + apikey + "&from=" + + from + "&to=91" + mobileNumber + "" + + "&type=template&templateid=3037264&placeholders=" + placeholders + "" + + "&button_placeholder=dumpregistration/paymentform?requestId=" +button_placeholder + "" ; + + + + System.out.println("WhatsApp API URL: " + whatsappMsg); + smsService.sendMsg(whatsappMsg); + + + }catch (Exception e) { + + e.printStackTrace(); + } + } public List> getAllRequestDetails(LocalDate fromDate, LocalDate toDate, String wastequantity, String zone) { diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/controller/NulmAPIController.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/controller/NulmAPIController.java index d868450f..cfdcf140 100644 --- a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/controller/NulmAPIController.java +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/controller/NulmAPIController.java @@ -24,6 +24,7 @@ import org.springframework.format.annotation.DateTimeFormat; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -97,6 +98,18 @@ public class NulmAPIController { return ResponseEntity.status(500).body("Error saving Scheme Group: " + e.getMessage()); } } + + @GetMapping("/attendance-dates") // need to add + public ResponseEntity>> getAttendanceDates( + @RequestParam(required = false) String enrollmentId, + @RequestParam(required = false) String fromdate, + @RequestParam(required = false) String todate, + @RequestParam(required = false) String type, + Model model) { + + return ResponseEntity.ok(nulmService.fetchAttendanceDates(enrollmentId, fromdate, todate, type)); + + } /* * @PostMapping("/saveOrder") diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/controller/NulmController.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/controller/NulmController.java index c585a51c..79368476 100644 --- a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/controller/NulmController.java +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/controller/NulmController.java @@ -7,6 +7,7 @@ import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; import java.net.URLDecoder; import java.nio.charset.StandardCharsets; @@ -71,6 +72,27 @@ public class NulmController { // Return the view name return "modules/nulm/updated-staff"; } + + /// + + @GetMapping("/updateStaffPark") + public String viewUpdateScreenPark( + @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> enrollments = nulmService.getEnrollmentsForPark(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 + + // Return the view name + return "modules/nulm/updated-staff-park"; + } + + /// @GetMapping("/salaryDetails") public String getSalaryDetails( @@ -260,6 +282,35 @@ public class NulmController { return "modules/nulm/zone-wise-report"; // Returns the view 'salary-zonereport' } + + /// + + @GetMapping("/salary-zonereport-park") + public String viewParkZoneWiseReport( + @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> zoneWiseReport = new ArrayList<>(); + + // Only fetch the report if month, year and zone are provided + if (month != null && year != null && zone != null) { + zoneWiseReport = nulmService.getZoneWiseReportPark(month, year, salaryStatus, groupName, zone, division); + } + + // Add the fetched data to the model + model.addAttribute("zonewiseReport", zoneWiseReport); + + return "modules/nulm/zone-wise-report-park"; // Returns the view 'salary-zonereport' + } + + /// @GetMapping("/attendance-report") public String viewAttendanceReport( @@ -309,8 +360,40 @@ public class NulmController { return "modules/nulm/attendance-report"; } + + /// + + @GetMapping("/consolidated-attendance-report-park") // need to add + public String viewParkConsolidatedAttendanceReport( + @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> consolidatedAttendanceReport = new ArrayList<>(); + + // Only fetch the report if month, year and zone are provided + if (division != null && zone != null) { + consolidatedAttendanceReport = nulmService.getParkConsolidatedAttendanceReport(fromdate, todate, groupName, + zone, division); + } + + // Add the fetched data to the model + model.addAttribute("consolidatedAttendanceReport", consolidatedAttendanceReport); + model.addAttribute("fromdate", fromdate); + model.addAttribute("todate", todate); + + return "modules/nulm/attendance-report-park"; + } + + /// + @GetMapping("/attendance-dates") // need to add + @ResponseBody public ResponseEntity>> getAttendanceDates( @RequestParam(required = false) String enrollmentId, @RequestParam(required = false) String fromdate, @@ -321,6 +404,8 @@ public class NulmController { return ResponseEntity.ok(nulmService.fetchAttendanceDates(enrollmentId, fromdate, todate, type)); } + + /// @GetMapping("/self-help-group") // need to add public String viewSelfHelpGroup(Model model) { @@ -356,6 +441,33 @@ public class NulmController { return "modules/nulm/salary-nonInitiatedreport"; } + + /// + + @GetMapping("/salary-nonInitiated-park") + public String viewParkSalaryNotInitiatedReport( + @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> salaryNotInitiatedReport = new ArrayList<>(); + + if (month != null && year != null) { + salaryNotInitiatedReport = nulmService.getSalaryNotInitiatedReportPark(month, year, groupName); + } + + model.addAttribute("salaryNonInitiatedReport", salaryNotInitiatedReport); + + return "modules/nulm/salary-nonInitiatedreport-park"; + } + + /// + @GetMapping("/staffupdate") public String staffupdate(Model model) { diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/service/NulmService.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/service/NulmService.java index 19ec0427..91f5e449 100644 --- a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/service/NulmService.java +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/service/NulmService.java @@ -360,7 +360,7 @@ public class NulmService { "FROM enrollment_table e " + "LEFT JOIN order_details o ON e.order_id = o.order_id " + "LEFT JOIN suyaudavi_kuzhu s ON e.group_id = s.group_id " + - "WHERE e.appointed = '1' AND e.isactive = '1' AND e.isdelete = '0'"); + "WHERE e.appointed = '1' AND e.isactive = '1' AND e.isdelete = '0' AND e.emp_type='NULM' "); if (department != null && !department.isEmpty()) { sql.append(" AND e.department = '").append(department).append("'"); @@ -371,6 +371,25 @@ public class NulmService { return jdbcTemplate.queryForList(sql.toString()); } + + /// + public List> getEnrollmentsForPark(String department, String division) { + StringBuilder sql = new StringBuilder("SELECT e.*, o.order_number, s.group_name " + + "FROM enrollment_table e " + + "LEFT JOIN order_details o ON e.order_id = o.order_id " + + "LEFT JOIN suyaudavi_kuzhu s ON e.group_id = s.group_id " + + "WHERE e.appointed = '1' AND e.isactive = '1' AND e.isdelete = '0' AND e.emp_type='Park' "); + + if (department != null && !department.isEmpty()) { + sql.append(" AND e.department = '").append(department).append("'"); + } + if (division != null && !division.isEmpty()) { + sql.append(" AND e.division = '").append(division).append("'"); + } + + return jdbcTemplate.queryForList(sql.toString()); + } + /// public List> getDepartment() { String sql = "SELECT DISTINCT department FROM enrollment_table WHERE isactive = 1 AND isdelete = 0"; @@ -2428,7 +2447,7 @@ public class NulmService { + "DAY(LAST_DAY(STR_TO_DATE(CONCAT(s.year, '-', s.month, '-01'), '%Y-%M-%d'))) AS total_days from salary_details s " + "left join enrollment_table en on s.enrollment_id = en.enrollment_id " + "left join suyaudavi_kuzhu sk on s.group_id = sk.group_id " - + "where s.month = ? and s.year =? " + + "where s.month = ? and s.year =? AND en.emp_type='NULM' " + "AND (s.salary_status = 'Initiated' OR s.salary_status = 'Approved') " + (salaryStatus != null && !salaryStatus.isEmpty() ? "AND s.salary_status = ? " : "") + (groupName != null && !groupName.isEmpty() ? "AND sk.group_name = ? " : "") @@ -2455,6 +2474,45 @@ public class NulmService { List> results = jdbcTemplate.queryForList(sql.toString(), params.toArray()); return results; } + + /// + + public List> getZoneWiseReportPark(String month, Integer year, String salaryStatus, + String groupName, String zone, String division) { + String sql = "select en.zone,en.division, en.emp_id, en.name, en.incharge_name, en.incharge_designation, sk.group_name, s.total_days_present, s.total_days_od, " + + "s.total_days_absent, s.total_days_salary, s.month as imonth,s.year as iyear, s.salary_status, s.salary_amount as total_salary, " + + "DAY(LAST_DAY(STR_TO_DATE(CONCAT(s.year, '-', s.month, '-01'), '%Y-%M-%d'))) AS total_days from salary_details_park s " + + "left join enrollment_table en on s.enrollment_id = en.enrollment_id " + + "left join suyaudavi_kuzhu sk on s.group_id = sk.group_id " + + "where s.month = ? and s.year =? AND en.emp_type='Park' " + + "AND (s.salary_status = 'Initiated' OR s.salary_status = 'Approved') " + + (salaryStatus != null && !salaryStatus.isEmpty() ? "AND s.salary_status = ? " : "") + + (groupName != null && !groupName.isEmpty() ? "AND sk.group_name = ? " : "") + + (zone != null && !zone.isEmpty() ? "AND en.zone = ? " : "") + + (division != null && !division.isEmpty() ? "AND en.division = ? " : ""); + + // Prepare the query parameters based on provided inputs + List params = new ArrayList<>(); + params.add(month); + params.add(year); + if (salaryStatus != null && !salaryStatus.isEmpty()) { + params.add(salaryStatus); + } + if (groupName != null && !groupName.isEmpty()) { + params.add(groupName); + } + if (zone != null && !zone.isEmpty()) { + params.add(zone); + } + if (division != null && !division.isEmpty()) { + params.add(division); + } + + List> results = jdbcTemplate.queryForList(sql.toString(), params.toArray()); + return results; + } + + /// public List> getAttendanceReport(String fromdate, String todate, String groupName, String zone, String division) { @@ -2756,7 +2814,55 @@ public class NulmService { "et.incharge_name, et.incharge_phoneno, et.incharge_designation, et.zone, " + "et.division, et.department, sk.group_name from attendance att " + " left join enrollment_table et on att.enrollment_id = et.enrollment_id " - + " left join suyaudavi_kuzhu sk on et.group_id = sk.group_id where " + + " left join suyaudavi_kuzhu sk on et.group_id = sk.group_id where et.emp_type='NULM' AND " + + " (DATE(att.indatetime) BETWEEN STR_TO_DATE('" + fromdate + "', '%Y-%m-%d') AND STR_TO_DATE('" + + todate + "', '%Y-%m-%d') " + + " OR DATE(att.oddatetime) BETWEEN STR_TO_DATE('" + fromdate + "', '%Y-%m-%d') AND STR_TO_DATE('" + + todate + "', '%Y-%m-%d')" + + " OR DATE(att.leavedatetime) BETWEEN STR_TO_DATE('" + fromdate + "', '%Y-%m-%d') AND STR_TO_DATE('" + + todate + "', '%Y-%m-%d')) " + + (zone != null && !zone.isEmpty() ? " and et.zone = ? " : "") + + (division != null && !division.isEmpty() ? " and et.division = ? " : "") + + (groupName != null && !groupName.isEmpty() ? " and sk.group_name = ? " : "") + + " group by et.emp_id, et.enrollment_id, et.name, et.incharge_name, et.incharge_phoneno, et.incharge_designation, et.zone, " + + " et.division, et.department, sk.group_name"; + + // Prepare the query parameters based on provided inputs + List params = new ArrayList<>(); + // params.add(fromdate); + // params.add(todate); + if (groupName != null && !groupName.isEmpty()) { + params.add(groupName); + } + if (zone != null && !zone.isEmpty()) { + params.add(zone); + } + if (division != null && !division.isEmpty()) { + params.add(division); + } + + List> results = jdbcTemplate.queryForList(sql.toString(), params.toArray()); + return results; + } + + /// + + public List> getParkConsolidatedAttendanceReport(String fromdate, String todate, String groupName, + String zone, String division) { // newly added + String sql = "select \n" + + "et.emp_id, et.enrollment_id, et.name, " + + "MAX(DAY(LAST_DAY(COALESCE(att.indatetime, att.leavedatetime, att.oddatetime)))) AS total_days, " + + "count(distinct date(att.indatetime)) as totaldayspresent, " + + "count(distinct case when att.indatetime is null then date(att.oddatetime) end) as totaldaysod, " + + "count(distinct date(att.leavedatetime)) as totaldaysleave, " + + "MAX(DAY(LAST_DAY(COALESCE(att.indatetime, att.leavedatetime, att.oddatetime)))) - " + + "((count(distinct date(att.indatetime)) + " + + "count(distinct case when att.indatetime is null then date(att.oddatetime) end) + " + + "count(distinct date(att.leavedatetime)))) as totaldaysabsent, " + + "et.incharge_name, et.incharge_phoneno, et.incharge_designation, et.zone, " + + "et.division, et.department, sk.group_name from attendance att " + + " left join enrollment_table et on att.enrollment_id = et.enrollment_id " + + " left join suyaudavi_kuzhu sk on et.group_id = sk.group_id where et.emp_type='Park' AND " + " (DATE(att.indatetime) BETWEEN STR_TO_DATE('" + fromdate + "', '%Y-%m-%d') AND STR_TO_DATE('" + todate + "', '%Y-%m-%d') " + " OR DATE(att.oddatetime) BETWEEN STR_TO_DATE('" + fromdate + "', '%Y-%m-%d') AND STR_TO_DATE('" @@ -2786,12 +2892,16 @@ public class NulmService { List> results = jdbcTemplate.queryForList(sql.toString(), params.toArray()); return results; } + + + /// + public Map> fetchAttendanceDates(String enrollmentId, String fromdate, String todate, String type) { // newly added Map> attendanceData = new HashMap<>(); - if (type.equals("present")) { + if ("present".equals(type)) { String presentQuery = "SELECT DISTINCT DATE_FORMAT(DATE(indatetime), '%d-%m-%Y') AS PresentDates " + "FROM attendance WHERE enrollment_id = ? AND DATE(indatetime) BETWEEN STR_TO_DATE(? , '%Y-%m-%d') AND " + @@ -2799,23 +2909,29 @@ public class NulmService { attendanceData.put("presentDates", jdbcTemplate.queryForList(presentQuery, String.class, enrollmentId, fromdate, todate)); - } else if (type.equals("od")) { + } else if ("od".equals(type)) { String odQuery = "SELECT DISTINCT DATE_FORMAT(DATE(oddatetime), '%d-%m-%Y') AS OdDates " + "FROM attendance WHERE enrollment_id = ? AND DATE(oddatetime) BETWEEN STR_TO_DATE(?, '%Y-%m-%d') AND STR_TO_DATE(?, '%Y-%m-%d')"; attendanceData.put("odDates", jdbcTemplate.queryForList(odQuery, String.class, enrollmentId, fromdate, todate)); - } else if (type.equals("leave")) { + } else if ("leave".equals(type)) { String leaveQuery = "SELECT DISTINCT DATE_FORMAT(DATE(leavedatetime), '%d-%m-%Y') AS LeaveDates " + "FROM attendance WHERE enrollment_id = ? AND DATE(leavedatetime) BETWEEN STR_TO_DATE(?, '%Y-%m-%d') AND STR_TO_DATE(?, '%Y-%m-%d')"; attendanceData.put("leaveDates", jdbcTemplate.queryForList(leaveQuery, String.class, enrollmentId, fromdate, todate)); - } else if (type.equals("absent")) { + } else if ("absent".equals(type)) { String absentQuery = ""; } return attendanceData; } + + /// + + + + /// public List> getSelfHelpGroupDetails() { // newly added String sql = "select * from suyaudavi_kuzhu where isactive = 1 and isdelete =0 order by group_name asc"; @@ -2829,7 +2945,7 @@ public class NulmService { + "FROM enrollment_table e " + "left join suyaudavi_kuzhu sk on e.group_id = sk.group_id " + - "WHERE NOT EXISTS ( SELECT 1 " + + "WHERE e.emp_type='NULM' AND NOT EXISTS ( SELECT 1 " + " FROM salary_details s " + " WHERE e.enrollment_id = s.enrollment_id " + " AND s.month = ? " + @@ -2847,6 +2963,35 @@ public class NulmService { return jdbcTemplate.queryForList(sql, params.toArray()); } + + /// + + public List> getSalaryNotInitiatedReportPark(String month, Integer year, String groupName) { + + String sql = "SELECT e.emp_id, e.name, e.designation, e.incharge_name, e.incharge_designation, e.incharge_phoneno, sk.group_name " + + + "FROM enrollment_table e " + + "left join suyaudavi_kuzhu sk on e.group_id = sk.group_id " + + "WHERE e.emp_type='Park' AND NOT EXISTS ( SELECT 1 " + + " FROM salary_details_park s " + + " WHERE e.enrollment_id = s.enrollment_id " + + " AND s.month = ? " + + " AND s.year = ? )" + + (groupName != null && !groupName.isEmpty() ? " and sk.group_name = ? " : ""); + + List params = new ArrayList<>(); + + params.add(month); + params.add(year); + + if (groupName != null && !groupName.isEmpty()) { + params.add(groupName); + } + + return jdbcTemplate.queryForList(sql, params.toArray()); + } + + /// public boolean checkSalaryDetails(int enrollmentId, String month, int year) { String sql = "select enrollment_id from salary_details where enrollment_id =? and month = ? and year = ?"; diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/vtrack/service/VehicleService.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/vtrack/service/VehicleService.java index ad0ffad2..c85093d2 100644 --- a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/vtrack/service/VehicleService.java +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/vtrack/service/VehicleService.java @@ -738,6 +738,29 @@ public class VehicleService { + "&placeholders=POS%20Collection%20Details"; break; + + case "26": + System.out.println("TempID is 26 (1590940 - Health - Tobacco seizures - IMAGE - STATIC)"); + urlString = "https://media.smsgupshup.com/GatewayAPI/rest?" + + "userid=" + username + + "&password=" + password + + "&send_to=" + sendTo + + "&v=1.1&format=json" + + "&msg_type=IMAGE" + + "&method=SENDMEDIAMESSAGE" + + "&caption=%2AGCC+Enforcement+Team+Monitoring%2A%0A%0AToday%27s+%28" + msgDate + + "%29+Zone+wise+Enforcement+Team+activity+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below." + + "&media_url=" + fileURL + + "&isTemplate=true&footer=GCC+-+IT+Cell"; + + urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template" + + "&apikey=" + apikey + + "&from=" + from + + "&to={{to}}&templateid=2784943" + + "&url=" + fileURL + + "&placeholders=Health-%20Tobacco%20seizures"; + + break; default: System.out.println("TempID (" + tempid + ") is unknown"); diff --git a/gcc_officer_portal/src/main/resources/templates/modules/nulm/attendance-report-park.html b/gcc_officer_portal/src/main/resources/templates/modules/nulm/attendance-report-park.html new file mode 100644 index 00000000..4e884c5d --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/nulm/attendance-report-park.html @@ -0,0 +1,552 @@ + + + + + + + + + + +
+
+ +
+
+
+
+ + +
+ + +
+ +
+ + +
+ + +
+ + +
+ + + + +
+ + +
+ +
+ + +
+ + + +
+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
S.NoEmployee IdEmployee NameTotal no.of DaysPresent DaysOD DaysLeave DaysAbsent DaysIncharge NameIncharge Mobile NumberIncharge DesignationZoneDivisionDepartmentSelf Help Group
1
S.NoEmployee IdEmployee NameTotal no.of DaysPresent DaysOD DaysLeave DaysAbsent DaysIncharge NameIncharge Mobile NumberIncharge DesignationZoneDivisionDepartmentSelf Help Group
+
+ + + + + +
+ +
+
+
+
+ + +
+ + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/nulm/attendance-report.html b/gcc_officer_portal/src/main/resources/templates/modules/nulm/attendance-report.html index f1dce167..423af53d 100644 --- a/gcc_officer_portal/src/main/resources/templates/modules/nulm/attendance-report.html +++ b/gcc_officer_portal/src/main/resources/templates/modules/nulm/attendance-report.html @@ -494,12 +494,14 @@ }); function fetchAttendanceDates(type, enrollmentId, fromdate, todate, name) { - const apiUrl = `/gcc/nulm/attendance-dates?enrollmentId=${enrollmentId}&fromdate=${fromdate}&todate=${todate}&type=${type}`; + const apiUrl = `/gcc/api/nulm/attendance-dates?enrollmentId=${enrollmentId}&fromdate=${fromdate}&todate=${todate}&type=${type}`; + console.log("type="+type); fetch(apiUrl) .then(response => response.json()) .then(data => { let dates = data[`${type}Dates`] || []; + console.log("dates="+dates); showModal(type, dates, fromdate, todate, name); }) .catch(error => { diff --git a/gcc_officer_portal/src/main/resources/templates/modules/nulm/updated-staff-park.html b/gcc_officer_portal/src/main/resources/templates/modules/nulm/updated-staff-park.html new file mode 100644 index 00000000..b3cd2084 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/nulm/updated-staff-park.html @@ -0,0 +1,380 @@ + + + + + + + + + + +
+ +
+ + +
+ +
+ +
+
+ + +
+
+ +
+ +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
S.NoEmployee IDEmployee NameDesignationGenderDate Of BirthAction
0 + +
S.NoEmployee IDEmployee NameDesignationGenderDate Of BirthAction
+
+
+ + + + + + + + +
+ + +
+ + + +
+
+
+ +
+ +
+ + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/nulm/zone-wise-report-park.html b/gcc_officer_portal/src/main/resources/templates/modules/nulm/zone-wise-report-park.html new file mode 100644 index 00000000..a9456a83 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/nulm/zone-wise-report-park.html @@ -0,0 +1,430 @@ + + + + + + + +
+
+ +
+
+
+
+ + +
+ + +
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ +
+ + +
+ + + + + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
S.NoEmployee IdEmployee NameIncharge NameIncharge DesignationZoneDivisionSelf Help GroupDays PresentODTotal Days for SalaryTotal DaysTotal Days AbsentMonthYearSalary AmountSalary Status
1
S.NoEmployee IdEmployee NameIncharge NameIncharge DesignationZoneDivisionSelf Help GroupDays PresentODTotal Days for SalaryTotal DaysTotal Days AbsentMonthYearSalary AmountSalary Status
+
+ +
+
+ +
+
+
+ +
+ + + + + \ No newline at end of file