From 438950d14e546004cb72e2efc9fc8dbaf81bde1e Mon Sep 17 00:00:00 2001 From: yoganandhank Date: Fri, 28 Feb 2025 15:02:47 +0530 Subject: [PATCH] first commit --- .../service/DepartmentReceivedService.java | 2 +- .../pensioner/service/NewEntryService.java | 15 +++---- .../pensioner/service/ReportApiService.java | 4 +- .../completed/contributorypensionscheme.html | 9 ++++- .../department/completed/familypension.html | 8 ++-- .../completed/provisionalretirement.html | 6 +++ .../newentry/contributorypensionscheme.html | 8 +++- .../newentry/provisionalretirement.html | 39 ++++++++++++++++++- .../department/partial/familypension.html | 2 +- .../department/partial/pendency.html | 2 +- .../department/partial/retirement.html | 2 +- .../received/provisionalretirement.html | 36 +++++++++++++++-- frontend/pensioner/department/reports.html | 18 +++++++++ .../completed/contributorypensionscheme.html | 11 ++++-- .../pensioner/completed/familypension.html | 6 +-- .../pensioner/completed/pendency.html | 4 +- .../completed/provisionalretirement.html | 6 +++ .../pensioner/partial/familypension.html | 2 +- .../pensioner/pensioner/partial/pendency.html | 2 +- .../pensioner/partial/retirement.html | 2 +- .../pensioner/received/pendency.html | 2 +- frontend/pensioner/pensioner/reports.html | 17 ++++++++ .../gcc_pensioner_cps_pensioner_details.sql | 1 + ...ensioner_cps_pensioner_details_history.sql | 1 + 24 files changed, 168 insertions(+), 37 deletions(-) diff --git a/backend/pensioner/service/DepartmentReceivedService.java b/backend/pensioner/service/DepartmentReceivedService.java index facfca4..26f1867 100644 --- a/backend/pensioner/service/DepartmentReceivedService.java +++ b/backend/pensioner/service/DepartmentReceivedService.java @@ -96,7 +96,7 @@ public class DepartmentReceivedService { file_entry_type="FILE_COMPLETED"; } - else if("no".equalsIgnoreCase(benefit_pension) || "no".equalsIgnoreCase(benefit_dcrg)){ + else if("no".equalsIgnoreCase(benefit_dcrg) || "no".equalsIgnoreCase(benefit_pension)){ filestatus = getFileStatus.getFileStatus10Id(); file_entry_type="PENSION_PARTIAL"; diff --git a/backend/pensioner/service/NewEntryService.java b/backend/pensioner/service/NewEntryService.java index 07f4103..62a3c38 100644 --- a/backend/pensioner/service/NewEntryService.java +++ b/backend/pensioner/service/NewEntryService.java @@ -667,7 +667,7 @@ public class NewEntryService { int rowsInserted = jdbcTemplate.update(query, empNo, empName, deptName, designation, typeOfRetirement,retirementClass ,retirementDate , ReasonofPension,dateToAudit,pendingDuration,reasonofPending,dp,remarks,filecategory,filestatus,fileentrytype,deptId,fc_name,otherReason,temp_id); String query1 = "INSERT INTO pensioner_details_history (emp_no, emp_name, dept_name, designation,type_of_retirement,retirement_class, retirement_date,reason_for_provisional_pension ,file_moved_date, remarks,pending_duration,reason_for_pending,dp ,file_category,file_status,file_entry_type,file_moved_by,dept_id,file_category_name,others_provisional_pension,temp_id) VALUES (?,?,?, ?, ?, ?, ?, ?, ?,?,?,?,?,?,?,?,?,?,?,?,?)"; - int rowsInsertedHistory = jdbcTemplate.update(query1, empNo, empName, deptName, designation,typeOfRetirement,retirementClass,retirementDate ,ReasonofPension,dateToAudit,pendingDuration,reasonofPending,dp,remarks,filecategory,filestatus,fileentrytype,filemovedby,deptId,fc_name,otherReason,temp_id); + int rowsInsertedHistory = jdbcTemplate.update(query1, empNo, empName, deptName, designation,typeOfRetirement,retirementClass,retirementDate ,ReasonofPension,dateToAudit,remarks,pendingDuration,reasonofPending,dp,filecategory,filestatus,fileentrytype,filemovedby,deptId,fc_name,otherReason,temp_id); String query2 = "INSERT INTO file_movement_history (emp_no,file_moved_date,file_status,file_moved_by,remarks,temp_id) VALUES (?, ?, ?, ?, ?,?)"; int rowsInsertedFileMovement = jdbcTemplate.update(query2, empNo,dateToAudit,filestatus,filemovedby,remarks,temp_id); @@ -695,6 +695,7 @@ public class NewEntryService { String fileMovedBy = requestData.get("fileMovedBy") != null ? requestData.get("fileMovedBy").toString() : null; String remarks = requestData.get("remarks") != null ? requestData.get("remarks").toString() : null; String retirementType = requestData.get("retirementType") != null ? requestData.get("retirementType").toString() : null; + String retirementdate = requestData.get("retirementdate") !=null ? requestData.get("retirementdate").toString() : null; String uac = (String) requestData.get("uac"); String uacDate = "yes".equals(uac) && requestData.get("uacDate") != null ? requestData.get("uacDate").toString() : null; @@ -734,23 +735,23 @@ public class NewEntryService { // Insert into cps_pensioner_details String queryDetails = "INSERT INTO cps_pensioner_details " + - "(emp_no, emp_name, dept_name, designation, file_category, retirement_class, type_of_retirement, uac, uac_date, " + + "(emp_no, emp_name, dept_name, designation, file_category, retirement_class, retirement_date,type_of_retirement, uac, uac_date, " + "pending_duration,reason_for_pending ,cps, cps_amount, el_or_lpa, el_or_lpa_amount, spfgs, spfgs_amount, remarks, " + "file_status, file_entry_type, dept_id, file_category_name,temp_id) " + - "VALUES (?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?)"; + "VALUES (?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?)"; int rowsInsertedDetails = jdbcTemplate.update(queryDetails, - empNo, empName, deptName, designation, filecategory, classes, retirementType, uac, uacDate, + empNo, empName, deptName, designation, filecategory, classes, retirementdate,retirementType, uac, uacDate, pendingDuration,reasonPending ,cps, cpsAmount, elOrLpa, elOrLpaAmount, spfgs, spfgsAmount, remarks, fileStatus, fileEntryType, deptId, fileCategoryName,temp_id); // Insert into cps_pensioner_details_history String queryHistory = "INSERT INTO cps_pensioner_details_history " + - "(emp_no, emp_name, dept_name, designation, file_category, retirement_class, type_of_retirement, uac, uac_date, " + + "(emp_no, emp_name, dept_name, designation, file_category, retirement_class, retirement_date,type_of_retirement, uac, uac_date, " + "pending_duration,reason_for_pending ,cps, cps_amount, el_or_lpa, el_or_lpa_amount, spfgs, spfgs_amount, remarks, " + "file_status, file_entry_type, file_moved_by, dept_id, file_category_name,temp_id) " + - "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?)"; + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?)"; int rowsInsertedHistory = jdbcTemplate.update(queryHistory, - empNo, empName, deptName, designation, filecategory, classes, retirementType, uac, uacDate, + empNo, empName, deptName, designation, filecategory, classes, retirementdate,retirementType, uac, uacDate, pendingDuration, reasonPending,cps, cpsAmount, elOrLpa, elOrLpaAmount, spfgs, spfgsAmount, remarks, fileStatus, fileEntryType, fileMovedBy, deptId, fileCategoryName,temp_id); diff --git a/backend/pensioner/service/ReportApiService.java b/backend/pensioner/service/ReportApiService.java index b159596..741a9db 100644 --- a/backend/pensioner/service/ReportApiService.java +++ b/backend/pensioner/service/ReportApiService.java @@ -138,7 +138,7 @@ public class ReportApiService { : ""; // Skip condition if fileStatus is empty or null if (fileCatId == 6) { - sql = "SELECT pd.emp_no, pd.emp_name, pd.designation, pd.type_of_retirement, pd.reason_for_pending, " + + sql = "SELECT pd.emp_no, pd.emp_name, pd.designation, pd.type_of_retirement, pd.reason_for_pending, pd.retirement_date, " + "fm.file_status AS fst, pd.file_category_name, pd.remarks, DATE(pd.created_date) AS created_date " + "FROM cps_pensioner_details pd " + "INNER JOIN file_status_master fm ON pd.file_status = fm.id " + @@ -460,7 +460,7 @@ public class ReportApiService { : ""; // Skip condition if fileStatus is empty or null if (fileCatId == 6) { - sql = "SELECT pd.emp_no, pd.emp_name, pd.designation, pd.type_of_retirement, pd.reason_for_pending, " + + sql = "SELECT pd.emp_no, pd.emp_name, pd.designation, pd.type_of_retirement, pd.reason_for_pending,pd.retirement_date, " + "fm.file_status AS fst, pd.file_category_name, pd.remarks, DATE(pd.created_date) AS created_date " + "FROM cps_pensioner_details pd " + "INNER JOIN file_status_master fm ON pd.file_status = fm.id " + diff --git a/frontend/pensioner/department/completed/contributorypensionscheme.html b/frontend/pensioner/department/completed/contributorypensionscheme.html index 06fe555..d193474 100644 --- a/frontend/pensioner/department/completed/contributorypensionscheme.html +++ b/frontend/pensioner/department/completed/contributorypensionscheme.html @@ -269,7 +269,7 @@ margin-top: 10px;
- +
diff --git a/frontend/pensioner/department/received/provisionalretirement.html b/frontend/pensioner/department/received/provisionalretirement.html index e4651f9..225a001 100644 --- a/frontend/pensioner/department/received/provisionalretirement.html +++ b/frontend/pensioner/department/received/provisionalretirement.html @@ -325,7 +325,7 @@ margin-top: 10px; @@ -352,7 +352,7 @@ margin-top: 10px; @@ -552,7 +552,7 @@ margin-top: 10px; $('#provisionalreason').val(employeeDetails.reason_for_provisional_pension); - // Populate Pending Duration and Reason fields + /* // Populate Pending Duration and Reason fields if (employeeDetails.pending_duration === "Yes") { $('#yespen').prop('checked', true); // Check the Yes radio button $('#clickyesdiv').show(); // Show the reason input @@ -560,7 +560,37 @@ margin-top: 10px; } else if (employeeDetails.pending_duration === "No") { $('#nopen').prop('checked', true); // Check the No radio button $('#clickyesdiv').hide(); // Hide the reason input + } */ + + + // Populate Pending Duration and Reason fields + if (employeeDetails.pending_duration === "Yes") { + $('#yespen').prop('checked', true).prop('disabled', false); // Check and enable Yes radio button + $('#nopen').prop('disabled', true); // Disable No radio button + $('#clickyesdiv').show(); // Show the reason input + $('#Clickyes').val(employeeDetails.reason_for_pending || '').prop('readonly', true); // Set reason and make readonly + } else if (employeeDetails.pending_duration === "No") { + $('#nopen').prop('checked', true).prop('disabled', false); // Check and enable No radio button + $('#yespen').prop('disabled', true); // Disable Yes radio button + $('#clickyesdiv').hide(); // Hide the reason input } + + // Add event listeners to ensure mutual exclusivity + $('#yespen').on('change', function () { + if ($(this).prop('checked')) { + $('#nopen').prop('disabled', true); + $('#clickyesdiv').show(); + $('#Clickyes').prop('readonly', false); + } + }); + + $('#nopen').on('change', function () { + if ($(this).prop('checked')) { + $('#yespen').prop('disabled', true); + $('#clickyesdiv').hide(); + } + }); + //populate reason for provisional pension if (employeeDetails.reason_for_provisional_pension === "Others") { $('#otherReasonDiv').show(); // Show the input field for 'Others' diff --git a/frontend/pensioner/department/reports.html b/frontend/pensioner/department/reports.html index 5bf15df..3f6bfec 100644 --- a/frontend/pensioner/department/reports.html +++ b/frontend/pensioner/department/reports.html @@ -292,6 +292,7 @@ td, th { Name Designation Type of Retirement + Date of Retirement Pending Duration File Status File category @@ -588,6 +589,21 @@ td, th { { title: "Name", data: "emp_name", className: "text-center" }, { title: "Designation", data: "designation", className: "text-center" }, { title: "Type of Retirement", data: "type_of_retirement", className: "text-center" }, + { + title: "Date of Retirement", + data: "retirement_date", + className: "text-center", + render: function(data, type, row) { + if (data) { + let date = new Date(data); + let day = String(date.getDate()).padStart(2, '0'); + let month = String(date.getMonth() + 1).padStart(2, '0'); + let year = date.getFullYear(); + return `${day}-${month}-${year}`; + } + return ""; + } + }, { title: "Pending Duration", data: "reason_for_pending", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" }, @@ -1165,6 +1181,7 @@ td, th { emp_name: row.emp_name, designation: row.designation, type_of_retirement: row.type_of_retirement, + retirement_date: row.retirement_date, reason_for_pending: row.reason_for_pending, fst: row.fst, file_category_name:row.file_category_name, @@ -1172,6 +1189,7 @@ td, th { created_date: row.created_date, })); fileDetailsTable.clear().rows.add(formattedData).draw(); + console.log("retirement data",formattedData); } diff --git a/frontend/pensioner/pensioner/completed/contributorypensionscheme.html b/frontend/pensioner/pensioner/completed/contributorypensionscheme.html index 06dec63..45307f3 100644 --- a/frontend/pensioner/pensioner/completed/contributorypensionscheme.html +++ b/frontend/pensioner/pensioner/completed/contributorypensionscheme.html @@ -266,7 +266,7 @@ margin-top: 10px;