From 4d84796829cac069ad6d1db89793322a9bc72e95 Mon Sep 17 00:00:00 2001 From: Hariprasath S <113695067+Hariprasath4022@users.noreply.github.com> Date: Wed, 20 May 2026 18:47:04 +0530 Subject: [PATCH] Reopen and Followup implemented in socialmedia complaints --- .../controller/SocialMediaApiController.java | 71 ++++++- .../service/QaqcAgentsService.java | 138 ++++++++++++-- .../service/SocialMediaService.java | 119 ++++++++++-- .../callcenterqaqc/complaintstatus.html | 36 +++- .../callcenterqaqc/socialmediacomplaints.html | 174 ++++++++++++++---- .../socialmediacompletedlist.html | 25 ++- 6 files changed, 479 insertions(+), 84 deletions(-) diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/controller/SocialMediaApiController.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/controller/SocialMediaApiController.java index e22f53a6..8d421f78 100644 --- a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/controller/SocialMediaApiController.java +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/controller/SocialMediaApiController.java @@ -51,7 +51,8 @@ public class SocialMediaApiController { @PostMapping("/update") @ResponseBody public ResponseEntity updateCallDetails(@RequestParam("complaintNumber") String complaintNumber, - @RequestParam("userId") String userId,@RequestParam("action") String action,@RequestParam("remarks") String remarks + @RequestParam("userId") String userId,@RequestParam("action") String action,@RequestParam("remarks") String remarks, + @RequestParam(value = "remainderDate", required = false) String remainderDate ) { try { // System.out.println("Updating Complaint Number: " + complaintNumber); @@ -59,7 +60,7 @@ public class SocialMediaApiController { // System.out.println("action= " + action); // System.out.println("remarks="+remarks); int updated_agent = Integer.parseInt(userId); -// System.out.println("updated_agent: " + updated_agent); +// System.out.println("remainderDate: " + remainderDate); if(remarks.isEmpty()) { remarks="N/A"; @@ -74,7 +75,7 @@ public class SocialMediaApiController { if ("COMPLETED".equals(action) || "REOPEN".equals(action)) { boolean statusUpdated =ChangeStatusInErp(complaintNumber,action,remarks,erp_name); - System.out.println("statusUpdated="+statusUpdated); + //System.out.println("statusUpdated="+statusUpdated); if (!statusUpdated) { @@ -84,7 +85,7 @@ public class SocialMediaApiController { Map details =getDetailsByComplaintNumber(complaintNumber); - int rowInserted=socialservice.uploadComplaintDetailsInLogs(details,action,remarks,updated_agent); + int rowInserted=socialservice.uploadComplaintDetailsInLogs(details,action,remarks,updated_agent,remainderDate); if(rowInserted!=1) { return ResponseEntity.ok("save"); @@ -102,8 +103,8 @@ public class SocialMediaApiController { try { String url = "https://erp.chennaicorporation.gov.in/pgr/newmobileservice?serviceId=getComplaintByID&ComplaintId=" - + complaintNumber + "&imgUrlonly=yes"; - System.out.println("Request URL: " + url); + + complaintNumber + "&imgUrlonly=yes&isQcuser=Yes&jsonResp=Yes"; + //System.out.println("Request URL: " + url); ResponseEntity responseEntity = restTemplate.getForEntity(url, String.class); @@ -272,7 +273,7 @@ public class SocialMediaApiController { String url="https://erp.chennaicorporation.gov.in/pgr/newmobileservice?serviceId=ms_dashboard_details&From_date="+formattedFromDate+"&To_date="+formattedToDate+"&jsonResp=Yes&Status="+status+"&isQcuser=Yes"+"&ComplaintType="+type+"&ComplaintGroupId="+group+"&compmode="+mode+"&Zoneid="+zone+"&RegionId="+region; - System.out.println(url); + //System.out.println(url); RestTemplate restTemplate = new RestTemplate(); @@ -287,8 +288,16 @@ public class SocialMediaApiController { } ObjectMapper objectMapper = new ObjectMapper(); Map responseMap = objectMapper.readValue(rawResponse, Map.class); - List> details = (List>) responseMap.get("Details"); + List> details; + details = (List>) responseMap.get("Details"); //System.out.println(details); + + if(status.equals("redressed") || status.equals("closed")) { + + details=socialservice.getfiltreddetails(details); + } + + if (details == null) { response.put("status", "nodata"); response.put("message", "No Data, please change criteria"); @@ -314,7 +323,7 @@ public class SocialMediaApiController { @RequestParam String endDate, @RequestParam String status, @RequestParam String zone) { - System.out.printf("==================="+startDate,endDate,zone); + //System.out.printf("==================="+startDate,endDate,zone); Map response = new HashMap<>(); try { @@ -349,4 +358,48 @@ public class SocialMediaApiController { return response; } + @GetMapping("/getA1dropdowns") + public ResponseEntity getA1dropdowns(){ + try { + List> list = socialservice.getA1dropdowns(); + + Map response = new HashMap<>(); + response.put("status", "success"); + response.put("data", list); + + return ResponseEntity.ok(response); + + } catch (Exception ex) { + ex.printStackTrace(); + + Map error = new HashMap<>(); + error.put("status", "error"); + error.put("message", ex.getMessage()); + + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error); + } + } + + @GetMapping("/getA2dropdowns") + public ResponseEntity getA2dropdowns(){ + try { + List> list = socialservice.getA2dropdowns(); + + Map response = new HashMap<>(); + response.put("status", "success"); + response.put("data", list); + + return ResponseEntity.ok(response); + + } catch (Exception ex) { + ex.printStackTrace(); + + Map error = new HashMap<>(); + error.put("status", "error"); + error.put("message", ex.getMessage()); + + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error); + } + } + } diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/QaqcAgentsService.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/QaqcAgentsService.java index 556eb2c2..f8da762e 100644 --- a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/QaqcAgentsService.java +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/QaqcAgentsService.java @@ -524,48 +524,150 @@ public class QaqcAgentsService { } +// public List> getAttendedComplainthistory( +// String startDate, String endDate, String complaintNumber, String complaintMobileNumber) { +// +// // Base query with JOIN to include agent_name +// StringBuilder query = new StringBuilder( +// "SELECT qcl.*, al.agent_name " + +// "FROM qaqc_call_logs qcl " + +// "LEFT JOIN agents_list al ON qcl.agent_id = al.agent_id " + +// "WHERE 1=1 "); +// +// // List to store query parameters +// List params = new ArrayList<>(); +// +// // Add date range condition if provided +// if (startDate != null && !startDate.isEmpty()) { +// query.append("AND DATE(qcl.created_date) >= ? "); +// params.add(startDate); +// } +// if (endDate != null && !endDate.isEmpty()) { +// query.append("AND DATE(qcl.created_date) <= ? "); +// params.add(endDate); +// } +// +// // Add complaint number condition if provided +// if (complaintNumber != null && !complaintNumber.isEmpty()) { +// query.append("AND qcl.complaint_number = ? "); +// params.add(complaintNumber); +// } +// +// // Add complaint mobile number condition if provided +// if (complaintMobileNumber != null && !complaintMobileNumber.isEmpty()) { +// query.append("AND qcl.complaint_mobilenumber = ? "); +// params.add(complaintMobileNumber); +// } +// +// // Group by qcl.id and agent_name to avoid SQL error +// query.append("GROUP BY qcl.id, al.agent_name "); +// +// // Add ordering clause +// query.append("ORDER BY qcl.created_date DESC"); +// +// // Execute the query with dynamic parameters +// return jdbcTemplate.queryForList(query.toString(), params.toArray()); +// } + public List> getAttendedComplainthistory( - String startDate, String endDate, String complaintNumber, String complaintMobileNumber) { + String startDate, + String endDate, + String complaintNumber, + String complaintMobileNumber) { - // Base query with JOIN to include agent_name StringBuilder query = new StringBuilder( - "SELECT qcl.*, al.agent_name " + + + "SELECT * FROM ( " + + + // ================= QAQC CALL LOGS ================= + "SELECT " + + "qcl.id, " + + "qcl.qaqc_id, " + + "qcl.call_category, " + + "qcl.agent_id, " + + "qcl.complaint_number, " + + "qcl.complaint_date, " + + "qcl.complaint_person_name, " + + "qcl.complaint_mobilenumber, " + + "qcl.complaint_type, " + + "qcl.complaint_mode, " + + "qcl.department, " + + "qcl.complaint_group, " + + "qcl.official_name, " + + "qcl.official_mobilenum, " + + "qcl.call_status, " + + "qcl.remainder_date, " + + "qcl.remarks, " + + "qcl.created_date, " + + "qcl.is_processed, " + + "qcl.updated_agent, " + + "al.agent_name, " + + "'QAQC' AS source_table " + + "FROM qaqc_call_logs qcl " + "LEFT JOIN agents_list al ON qcl.agent_id = al.agent_id " + - "WHERE 1=1 "); - // List to store query parameters + "UNION ALL " + + + // ================= SOCIAL MEDIA ================= + "SELECT " + + "smc.id, " + + "NULL AS qaqc_id, " + + "NULL AS call_category, " + + "smc.updated_by AS agent_id, " + + "smc.complaint_number, " + + "smc.complaint_date, " + + "smc.complaint_person_name, " + + "smc.complaint_mobilenumber, " + + "smc.complaint_type, " + + "smc.complaint_mode, " + + "smc.department, " + + "NULL AS complaint_group, " + + "smc.official_name, " + + "smc.official_mobilenum, " + + "smc.call_status, " + + "smc.remainder_date AS remainder_date, " + + "smc.remarks, " + + "smc.created_date, " + + "smc.is_processed AS is_processed, " + + "smc.updated_by AS updated_agent, " + + "al.agent_name, " + + "'SOCIAL_MEDIA' AS source_table " + + + "FROM social_media_completed smc " + + "LEFT JOIN agents_list al ON smc.updated_by = al.agent_id " + + + ") x WHERE 1=1 " + ); + List params = new ArrayList<>(); - // Add date range condition if provided + // ================= DATE FILTER ================= if (startDate != null && !startDate.isEmpty()) { - query.append("AND DATE(qcl.created_date) >= ? "); + query.append("AND DATE(x.created_date) >= ? "); params.add(startDate); } + if (endDate != null && !endDate.isEmpty()) { - query.append("AND DATE(qcl.created_date) <= ? "); + query.append("AND DATE(x.created_date) <= ? "); params.add(endDate); } - // Add complaint number condition if provided + // ================= COMPLAINT NUMBER ================= if (complaintNumber != null && !complaintNumber.isEmpty()) { - query.append("AND qcl.complaint_number = ? "); + query.append("AND x.complaint_number = ? "); params.add(complaintNumber); } - // Add complaint mobile number condition if provided + // ================= MOBILE NUMBER ================= if (complaintMobileNumber != null && !complaintMobileNumber.isEmpty()) { - query.append("AND qcl.complaint_mobilenumber = ? "); + query.append("AND x.complaint_mobilenumber = ? "); params.add(complaintMobileNumber); } - // Group by qcl.id and agent_name to avoid SQL error - query.append("GROUP BY qcl.id, al.agent_name "); + // ================= ORDER ================= + query.append("ORDER BY x.created_date DESC"); - // Add ordering clause - query.append("ORDER BY qcl.created_date DESC"); - - // Execute the query with dynamic parameters return jdbcTemplate.queryForList(query.toString(), params.toArray()); } diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/SocialMediaService.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/SocialMediaService.java index 6ab69885..9ad6f044 100644 --- a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/SocialMediaService.java +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/SocialMediaService.java @@ -4,7 +4,8 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Map; - +import java.time.LocalDate; +import java.util.HashMap; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Autowired; @@ -26,7 +27,7 @@ public class SocialMediaService { } @Transactional - public int uploadComplaintDetailsInLogs(Map details,String action,String remarks,int updated_agent) { + public int uploadComplaintDetailsInLogs(Map details,String action,String remarks,int updated_agent,String remainderDate) { //System.out.println("Complaint Details: " + details); // Extract other field values from complaintDetails String complaintNumber = details.get("complaintid").toString(); @@ -42,16 +43,22 @@ public class SocialMediaService { String remarksfield = remarks; String zone = details.get("Zone").toString(); int updated_by=updated_agent; + String cur_status = details.get("currentStatus").toString(); + + String finalremainderDate=null; + if(!remainderDate.isEmpty()) { + finalremainderDate=remainderDate; + } LocalDateTime currentDate = LocalDateTime.now(); String query = "INSERT INTO gcc_1913_qaqc.social_media_completed (complaint_number,zone,complaint_date, complaint_person_name,remarks, " - + "complaint_mobilenumber, complaint_type, complaint_mode, department, official_name,official_mobilenum, call_status,created_date,updated_by) " - + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?)"; + + "complaint_mobilenumber, complaint_type, complaint_mode, department, official_name,official_mobilenum, call_status,created_date,updated_by,cur_status,remainder_date) " + + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?,?)"; int rowsAffected = jdbcTemplate.update(query, complaintNumber,zone, complaintDate,personName,remarksfield, personMobNo, cType, cMode, department, officialName, officialMobileNum,callStatus, - currentDate,updated_by); + currentDate,updated_by,cur_status,finalremainderDate); //System.out.println("Rows Inserted in table : " + rowsAffected); return rowsAffected; @@ -59,7 +66,7 @@ public class SocialMediaService { } public List> getdetails(String formattedFromDate, String formattedToDate, String status, String zone) { - StringBuilder query = new StringBuilder("SELECT * FROM gcc_1913_qaqc.social_media_completed WHERE DATE(created_date) BETWEEN ? AND ? "); + StringBuilder query = new StringBuilder("SELECT *,DATE_FORMAT(remainder_date, '%d/%m/%Y') as formatted_fdate FROM gcc_1913_qaqc.social_media_completed WHERE DATE(created_date) BETWEEN ? AND ? "); List params = new ArrayList<>(); params.add(formattedFromDate); params.add(formattedToDate); @@ -74,15 +81,9 @@ public class SocialMediaService { params.add(status); } - // Log the query and parameters for debugging - //System.out.println("Executing query: " + query.toString()); - //System.out.println("With parameters: " + params); - // Execute the query List> results = jdbcTemplate.queryForList(query.toString(), params.toArray()); - // Log the results for debugging - //System.out.println("Query results: " + results); return results.isEmpty() ? null : results; } @@ -100,6 +101,100 @@ public class SocialMediaService { return erpUsername; } + public List> getA1dropdowns() { + String sql="SELECT * FROM call_status WHERE isactive=1 AND isdelete=0 AND call_category_id=5"; + try { + return jdbcTemplate.queryForList(sql); + } catch (Exception ex) { + ex.printStackTrace(); + return new ArrayList<>(); // return empty list on error + } + } + + public List> getA2dropdowns() { + String sql="SELECT * FROM call_status WHERE isactive=1 AND isdelete=0 AND call_category_id=6"; + try { + return jdbcTemplate.queryForList(sql); + } catch (Exception ex) { + ex.printStackTrace(); + return new ArrayList<>(); // return empty list on error + } + } + + public List> getfiltreddetails(List> details) { + + List> followupData = getFollowupData(); + + if (followupData == null || followupData.isEmpty()) { + return details; + } + + LocalDate currentDate = LocalDate.now(); + + // Store complaint_number -> followup row + Map> followupMap = new HashMap<>(); + + for (Map followup : followupData) { + + String complaintNumber = String.valueOf(followup.get("complaint_number")); + + followupMap.put(complaintNumber, followup); + } + + List> filteredDetails = new ArrayList<>(); + + for (Map detail : details) { + + String complaintNumber =String.valueOf(detail.get("Complaint Number")); + + // If complaint not in followup table + if (!followupMap.containsKey(complaintNumber)) { + + filteredDetails.add(detail); + continue; + } + + Map followupRow =followupMap.get(complaintNumber); + + String remainderDateStr =String.valueOf(followupRow.get("remainder_date")); + + LocalDate remainderDate = LocalDate.parse(remainderDateStr); + + // remainder_date <= current date + if (!remainderDate.isAfter(currentDate)) { + + // UPDATE is_processed = 0 + Integer id = (Integer) followupRow.get("id"); + + updateFollowupProcessed(id); + + filteredDetails.add(detail); + } + + // ELSE: + // remainder_date > currentDate + // skip / eliminate from frontend + } + + return filteredDetails; + } + + private void updateFollowupProcessed(Integer id) { + + String sql = + "UPDATE social_media_completed " + + "SET is_processed = 0 " + + "WHERE id = ?"; + + jdbcTemplate.update(sql, id); + } + + private List> getFollowupData() { + String sqlQuery = "select id, complaint_number,call_status, remainder_date from social_media_completed where is_processed=1 AND call_status='FOLLOWUP'"; + + return jdbcTemplate.queryForList(sqlQuery); + } + } diff --git a/gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/complaintstatus.html b/gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/complaintstatus.html index 5a8a1808..eb4eb769 100644 --- a/gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/complaintstatus.html +++ b/gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/complaintstatus.html @@ -114,17 +114,11 @@
-
+

Check Complaint Status

- - -
+ +
+ +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + +
diff --git a/gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/socialmediacomplaints.html b/gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/socialmediacomplaints.html index 74b2cb94..91568677 100644 --- a/gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/socialmediacomplaints.html +++ b/gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/socialmediacomplaints.html @@ -432,6 +432,68 @@ }); $(document).ready(function() { + + let a1Dropdowns = []; + let a2Dropdowns = []; + + // A1 Dropdown API + function loadA1Dropdowns() { + return $.ajax({ + url: '/gcc/api/callcenterqaqc/socialmedia/getA1dropdowns', + type: 'GET', + success: function(response) { + + if (response.status === "success") { + a1Dropdowns = response.data; + } + } + }); + } + + // A2 Dropdown API + function loadA2Dropdowns() { + return $.ajax({ + url: '/gcc/api/callcenterqaqc/socialmedia/getA2dropdowns', + type: 'GET', + success: function(response) { + + if (response.status === "success") { + a2Dropdowns = response.data; + } + } + }); + } + + // LOAD BOTH APIs INITIALY + $.when( + loadA1Dropdowns(), + loadA2Dropdowns() + ).done(function () { + + console.log("A1 Dropdowns Loaded", a1Dropdowns); + console.log("A2 Dropdowns Loaded", a2Dropdowns); + + }); + + $(document).on('change', '.action-dropdown', function () { + + let selectedValue = $(this).val(); + + let followupDateField = $(this) + .closest('.action-container') + .find('.followup-date'); + + if (selectedValue === "FOLLOWUP") { + + followupDateField.show(); + + } else { + + followupDateField.hide(); + followupDateField.val(''); + + } + }); var table = $('#ReportDatatable').DataTable({ dom: 'Bftip', @@ -606,24 +668,56 @@ { data: 'Assign To', defaultContent: '-', className: 'text-center' }, { data: 'Official Contact Number', defaultContent: '-', className: 'text-center' }, { - data: '', - defaultContent: '-', - className: 'text-center', + data: '', + defaultContent: '-', + className: 'text-center', render: function(data, type, row) { - let options = ` - `; + let dropdownData = []; + + // REDRESSED -> A1 + if (status === "redressed") { + dropdownData = a1Dropdowns; + } + + // CLOSED -> A2 + if (status === "closed") { + dropdownData = a2Dropdowns; + } + + if (status === "closed" || status === "redressed") { + + let options = ``; + + dropdownData.forEach(function(item) { + + options += ` + + `; + }); + + return ` +
+ + - if (status === "closed") { - options += ``; - } + - return (status === "closed" || status === "redressed") - ? `` - : '-'; - } +
+ `; + } + + return '-'; + } }, { data: null, @@ -1024,12 +1118,14 @@ // Find the closest table row and get the specific action and remarks const row = $(`button[data-complaint-number="${complaintNumber}"]`).closest('tr'); const actionValue = row.find('select').val(); // Select dropdown within the same row - const remarksValue = row.find('input').val(); // Input field within the same row + const remarksValue = row.find('#remarks').val(); + const remainderDate = row.find('.followup-date').val(); console.log("complaintNumber:",complaintNumber) console.log("Action:", actionValue); console.log("Remarks:", remarksValue); + console.log("Remainder Date:", remainderDate); // Check if action is empty if (actionValue === "") { @@ -1052,6 +1148,29 @@ return; // Stop execution if remarks are empty } + if (actionValue === "FOLLOWUP" && remainderDate === "") { + + Swal.fire({ + icon: 'warning', + title: 'Date Required', + text: 'Please select followup date.' + }); + + return; + } + + if (actionValue === "FOLLOWUP" && remarksValue.trim() === "") { + Swal.fire({ + icon: 'warning', + title: 'Remarks Required', + text: 'Please enter remarks.' + + }); + return; // Stop execution if remarks are empty + } + + + Swal.fire({ title: 'Are you sure to update?', text: 'This action will update the complaint.', @@ -1067,6 +1186,7 @@ reverseButtons: false // Optional: makes the "No" button appear first }).then((result) => { if (result.isConfirmed) { + $('#pageLoader').show(); // User clicked "Yes" $('.btn.btn-success').prop('disabled', true); $.ajax({ @@ -1076,9 +1196,11 @@ complaintNumber: complaintNumber, userId: userId, action: actionValue, // Add selected action to the request data - remarks: remarksValue // Add remarks to the request data + remarks: remarksValue, // Add remarks to the request data + remainderDate: remainderDate }, success: function (response) { + $('#pageLoader').hide(); if (response === "Success") { Swal.fire({ icon: 'success', @@ -1126,6 +1248,7 @@ } }, error: function (xhr, status, error) { + $('#pageLoader').hide(); $('.btn.btn-success').prop('disabled', false); Swal.fire("Error", `An error occurred: ${xhr.responseText || error}`, "error"); } @@ -1139,25 +1262,6 @@ - - \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/socialmediacompletedlist.html b/gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/socialmediacompletedlist.html index 17dc2721..2c59f4e5 100644 --- a/gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/socialmediacompletedlist.html +++ b/gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/socialmediacompletedlist.html @@ -123,7 +123,8 @@
@@ -435,7 +436,27 @@ { data: 'complaint_person_name', defaultContent: '-', className: 'text-center' }, { data: 'complaint_mobilenumber', defaultContent: '-', className: 'text-center' }, { data: 'official_name', defaultContent: '-', className: 'text-center' }, - { data: 'call_status', defaultContent: '-', className: 'text-center' }, + { + data: null, + defaultContent: '-', + className: 'text-center', + render: function(data, type, row) { + + if (row.call_status === "FOLLOWUP") { + + return ` +
+
${row.call_status}
+
+ ${row.formatted_fdate} +
+
+ `; + } + + return row.call_status || '-'; + } + }, { data: 'complaint_number', render: function(data, type, row) {