Browse Source

fixed the petreport for license with fetching rejected data and in ie report fixed date based data

master
AJITHKUMAR12 4 months ago
parent
commit
ecfd1644c7
  1. 19
      src/main/java/com/gcc/commissionerreview/service/IeComplaintsService.java
  2. 50
      src/main/resources/templates/modules/pet/petreport.html
  3. 12
      src/main/resources/templates/modules/vendorreport.html

19
src/main/java/com/gcc/commissionerreview/service/IeComplaintsService.java

@ -712,6 +712,10 @@ public class IeComplaintsService {
String complaintId,
String fromDate,
String toDate) {
System.out.println("zone:" + zone);
System.out.println("complaintId:" + complaintId);
System.out.println("fromDate:" + fromDate);
System.out.println("toDate:" + toDate);
Map<String, Object> response = new HashMap<>();
@ -744,14 +748,6 @@ public class IeComplaintsService {
sql.append("COUNT(DISTINCT CASE ");
sql.append("WHEN cd.status IN ('pending','completed') ");
if (fromDate != null && !fromDate.isEmpty()
&& toDate != null && !toDate.isEmpty()) {
sql.append("AND DATE(cd.cdate) BETWEEN ? AND ? ");
params.add(fromDate);
params.add(toDate);
}
sql.append("THEN cd.ref_id END) AS pending_count ");
sql.append("FROM gcc_street_vendor.ward_master wm ");
@ -770,6 +766,13 @@ public class IeComplaintsService {
sql.append("AND cd.complaint_id = ? ");
params.add(complaintId);
}
if (fromDate != null && !fromDate.isEmpty()
&& toDate != null && !toDate.isEmpty()) {
sql.append("AND DATE(cd.cdate) BETWEEN ? AND ? ");
params.add(fromDate);
params.add(toDate);
}
sql.append("WHERE wm.zone_id = ? ");
params.add(zone);

50
src/main/resources/templates/modules/pet/petreport.html

@ -71,6 +71,15 @@
#summaryTable thead tr.dt-hidden-header {
display: none !important;
}
#wardTable {
width: 100% !important;
}
#wardTable th,
#wardTable td {
white-space: nowrap;
}
</style>
</head>
@ -201,7 +210,7 @@
<tr>
<!-- <th rowspan="2">S.No</th> -->
<th rowspan="2">Zone</th>
<th colspan="3">License</th>
<th colspan="4">License</th>
<th colspan="3">Pet Vaccination</th>
<th colspan="3">Community Vaccination</th>
</tr>
@ -209,6 +218,7 @@
<th>Total</th>
<th>Completed</th>
<th>Pending</th>
<th>Rejected</th>
<th>Total</th>
<th>Completed</th>
<th>Pending</th>
@ -228,6 +238,7 @@
<td class="lic-total">0</td>
<td class="lic-completed">0</td>
<td class="lic-pending">0</td>
<td class="lic-rejected">0</td>
<td class="pet-total">0</td>
<td class="pet-completed">0</td>
<td class="pet-pending">0</td>
@ -265,6 +276,7 @@
<th>Total</th>
<th>Approved</th>
<th>Pending</th>
<th id="rejectedHeader">Rejected</th>
</tr>
</thead>
<tbody id="wardTableBody"></tbody>
@ -597,7 +609,7 @@
$('#pageLoader').hide();
let i = 1;
let licT = 0, licC = 0, licP = 0;
let licT = 0, licC = 0, licP = 0, licR = 0;
let petT = 0, petC = 0, petP = 0;
let comT = 0, comC = 0, comP = 0;
@ -627,6 +639,7 @@
</td>
<td>${lic.approved_Licenses}</td>
<td>${lic.pending_Licenses}</td>
<td>${lic.rejected_Licenses}</td>
<!-- PET VACCINATION -->
<td>
@ -656,6 +669,7 @@
licT += lic.total_licensesApplied;
licC += lic.approved_Licenses;
licP += lic.pending_Licenses;
licR += lic.rejected_Licenses;
petT += vacc.total;
petC += vacc.completed;
@ -673,6 +687,7 @@
$(".lic-total").text(licT);
$(".lic-completed").text(licC);
$(".lic-pending").text(licP);
$(".lic-rejected").text(licR);
$(".pet-total").text(petT);
$(".pet-completed").text(petC);
@ -764,6 +779,7 @@
async function openWardModal(type, zoneNo) {
$("#wardTableBody").empty();
$("#rejectedHeader").hide();
// Destroy previous DataTable
if ($.fn.DataTable.isDataTable('#wardTable')) {
@ -782,8 +798,10 @@
let title = '';
let wardList = [];
/* ================= LICENSE ================= */
if (type === 'LICENSE') {
$("#rejectedHeader").show();
title = `Zone ${zoneNo} – License`;
$("#modalZone").text(title);
@ -800,7 +818,8 @@
wardName: obj.wardName,
total: obj.total_licensesApplied,
completed: obj.approved_Licenses,
pending: obj.pending_Licenses
pending: obj.pending_Licenses,
rejected: obj.rejected_Licenses || 0
});
}
});
@ -867,6 +886,11 @@
/* ================= RENDER MODAL TABLE ================= */
let i = 1;
wardList.forEach(w => {
let rejectedColumn = '';
$("#wardTableBody").append(`
<tr>
<!--<td>${i++}</td>-->
@ -874,15 +898,35 @@
<td>${w.total}</td>
<td>${w.completed}</td>
<td>${w.pending}</td>
<td class="rejected-col">${w.rejected || 0}</td>
</tr>
`);
});
// Show rejected column only for License
if (type === 'LICENSE') {
$("#rejectedHeader").show();
$(".rejected-col").show();
} else {
$("#rejectedHeader").hide();
$(".rejected-col").hide();
}
/* ================= EXPORT ================= */
initWardExport(
title.replace(/\s+/g, '_') +
(fromDate && toDate ? `_${fromDate}_to_${toDate}` : '')
);
if ($.fn.DataTable.isDataTable('#wardTable')) {
const table = $('#wardTable').DataTable();
if (type === 'LICENSE') {
table.column(4).visible(true);
} else {
table.column(4).visible(false);
}
}
new bootstrap.Modal(document.getElementById("wardModal")).show();
}

12
src/main/resources/templates/modules/vendorreport.html

@ -1209,6 +1209,9 @@ ${(
let fromDate = $("#fromDate").val();
let toDate = $("#toDate").val();
console.log("ZONE", zone);
console.log("fromDate", fromDate);
console.log("toDate", toDate);
$.when(
@ -2052,7 +2055,9 @@ height="80">`
function openSchemeModal(ward) {
console.log("WARD =", ward);
if ($.fn.DataTable.isDataTable('#schemeTable')) {
$('#schemeTable').DataTable().destroy();
}
let fromDate = $("#fromDate").val();
let toDate = $("#toDate").val();
@ -2146,9 +2151,6 @@ ${row.total_complaint_pending_count}
}
$("#schemeTableBody").html(html);
if ($.fn.DataTable.isDataTable('#schemeTable')) {
$('#schemeTable').DataTable().destroy();
}
$('#schemeTable').DataTable({
@ -2442,7 +2444,7 @@ ${w.ward}
let total = Number(z.completed_count) + Number(z.pending_count);
let zoneCell = total > 0
? `<a href="javascript:void(0)" onclick="loadWardActivity('${z.zone_name}')">${z.zone_name}</a>`
? `<a href="javascript:void(0)" onclick="lsoadWardActivity('${z.zone_name} ','${fromDate},${toDate}')">${z.zone_name}</a>`
: `${z.zone_name}`;
html += `

Loading…
Cancel
Save