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 complaintId,
String fromDate, String fromDate,
String toDate) { 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<>(); Map<String, Object> response = new HashMap<>();
@ -744,14 +748,6 @@ public class IeComplaintsService {
sql.append("COUNT(DISTINCT CASE "); sql.append("COUNT(DISTINCT CASE ");
sql.append("WHEN cd.status IN ('pending','completed') "); 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("THEN cd.ref_id END) AS pending_count ");
sql.append("FROM gcc_street_vendor.ward_master wm "); sql.append("FROM gcc_street_vendor.ward_master wm ");
@ -770,6 +766,13 @@ public class IeComplaintsService {
sql.append("AND cd.complaint_id = ? "); sql.append("AND cd.complaint_id = ? ");
params.add(complaintId); 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 = ? "); sql.append("WHERE wm.zone_id = ? ");
params.add(zone); params.add(zone);

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

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

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

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

Loading…
Cancel
Save