Browse Source

implemented vendor pending for dahboard and zone section

master
AJITHKUMAR12 4 months ago
parent
commit
7672325e4d
  1. 37
      src/main/java/com/gcc/commissionerreview/service/IeComplaintsService.java
  2. 21
      src/main/java/com/gcc/commissionerreview/service/TenementService.java
  3. 382
      src/main/resources/templates/modules/vendorreport.html

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

@ -579,7 +579,7 @@ public class IeComplaintsService {
// PENDING = PENDING + COMPLETED
sql.append("COUNT(DISTINCT CASE ");
sql.append("WHEN cd.status IN ('pending','completed') ");
sql.append("WHEN cd.status IN ('pending') ");
if (fromDate != null && !fromDate.isEmpty()
&& toDate != null && !toDate.isEmpty()) {
@ -589,7 +589,21 @@ public class IeComplaintsService {
params.add(toDate);
}
sql.append("THEN cd.ref_id END) AS pending_count ");
sql.append("THEN cd.ref_id END) AS vendor_pending_count, ");
// IE PENDING
sql.append("COUNT(DISTINCT CASE ");
sql.append("WHEN cd.status IN ('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 ie_pending_count ");
sql.append("FROM gcc_street_vendor.zone_master zm ");
@ -1246,9 +1260,9 @@ public class IeComplaintsService {
sql.append("THEN cd.ref_id END) AS completed_count, ");
// PENDING = PENDING + COMPLETED
// PENDING = PENDING
sql.append("COUNT(DISTINCT CASE ");
sql.append("WHEN cd.status IN ('pending','completed') ");
sql.append("WHEN cd.status IN ('pending') ");
if (fromDate != null && !fromDate.isEmpty()
&& toDate != null && !toDate.isEmpty()) {
@ -1258,7 +1272,20 @@ public class IeComplaintsService {
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("COUNT(DISTINCT CASE ");
sql.append("WHEN cd.status IN ('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 ie_pending_count ");
sql.append("FROM complaint_master cm ");

21
src/main/java/com/gcc/commissionerreview/service/TenementService.java

@ -72,10 +72,15 @@ public class TenementService {
"WHEN final_status = 'verified' " +
"THEN 1 END) AS completed_count, " +
// PENDING = CREATED + COMPLETED
// PENDING = CREATED
"COUNT(CASE " +
"WHEN final_status IN ('created','completed') " +
"THEN 1 END) AS pending_count " +
"WHEN final_status IN ('created') " +
"THEN 1 END) AS pending_count, " +
// completed
"COUNT(CASE " +
"WHEN final_status IN ('completed') " +
"THEN 1 END) AS ie_pending_count " +
"FROM issue_list1";
@ -226,9 +231,15 @@ public class TenementService {
// PENDING = CREATED + COMPLETED
"COUNT(DISTINCT CASE " +
"WHEN il1.final_status IN ('created','completed') " +
"WHEN il1.final_status IN ('created') " +
"THEN il1.id END) " +
"AS total_complaint_pending_count " +
"AS total_complaint_pending_count, " +
// IE PENDING = CREATED + COMPLETED
"COUNT(DISTINCT CASE " +
"WHEN il1.final_status IN ('completed') " +
"THEN il1.id END) " +
"AS total_complaint_ie_pending_count " +
"FROM asset_master am " +

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

@ -12,6 +12,169 @@
<link href="https://cdn.datatables.net/buttons/2.3.6/css/buttons.dataTables.min.css" rel="stylesheet" />
<style>
.pending-summary-box {
border: 1px solid #d9d9d9;
border-radius: 10px;
background: #f6f3fb;
margin-top: 8px;
padding: 6px;
}
.pending-title {
text-align: center;
font-size: 16px;
font-weight: 600;
margin-bottom: 4px;
}
.pending-content {
display: flex;
align-items: center;
justify-content: center;
}
.pending-item {
flex: 1;
text-align: center;
}
.pending-item p {
font-size: 14px;
}
.pending-item h4 {
margin: 0;
color: #1f5fd4;
font-weight: bold;
font-size: 22px;
}
.pending-divider {
width: 1px;
height: 45px;
background: #cfcfcf;
}
/* Pending container */
.pending-container {
background: #e7e2ec;
border: 1px dashed #ccc;
border-radius: 6px;
padding: 12px;
margin-top: 10px;
}
.pending-row {
display: flex;
align-items: center;
}
.pending-col {
flex: 1;
text-align: center;
}
.pending-col p {
margin-bottom: 5px;
}
.pending-col h4 {
font-weight: 700;
color: #1e63d5;
margin: 0;
}
.pending-divider {
width: 1px;
height: 60px;
background: #bfbfbf;
}
.summary-card-body {
padding: 15px;
}
/* Top Row */
.top-row {
display: flex;
gap: 15px;
margin-bottom: 15px;
}
.top-row .stat-box {
flex: 1;
}
.stat-box {
text-align: center;
border-radius: 8px;
padding: 18px;
}
.total {
background: #d9e8f3;
}
.completed {
background: #d9f0d6;
}
.stat-title {
font-size: 20px;
margin-bottom: 10px;
}
.stat-value {
font-size: 42px;
font-weight: bold;
color: #1f5fd1;
}
/* Pending Section */
.pending-box {
background: #ece7f4;
border-radius: 8px;
padding: 15px;
}
.pending-title {
text-align: center;
font-size: 20px;
font-weight: 600;
margin-bottom: 15px;
}
.pending-content {
display: flex;
align-items: center;
justify-content: center;
}
.pending-col {
flex: 1;
text-align: center;
}
.pending-divider {
width: 1px;
height: 70px;
background: #c5c5c5;
}
.pending-label {
font-size: 18px;
margin-bottom: 10px;
font-weight: 600;
}
.pending-value {
font-size: 36px;
font-weight: bold;
color: #1f5fd1;
word-break: break-word;
}
#ieSummaryTable {
border-collapse: collapse;
width: 100%;
@ -110,35 +273,40 @@
/* Sweeping */
#zoneTable tbody td:nth-child(2),
#zoneTable tbody td:nth-child(3),
#zoneTable tbody td:nth-child(4) {
#zoneTable tbody td:nth-child(4),
#zoneTable tbody td:nth-child(5) {
background-color: #f8f9fa;
}
/* Hotspot - Dark */
#zoneTable tbody td:nth-child(5),
#zoneTable tbody td:nth-child(6),
#zoneTable tbody td:nth-child(7) {
#zoneTable tbody td:nth-child(7),
#zoneTable tbody td:nth-child(8),
#zoneTable tbody td:nth-child(9) {
background-color: #E1ECFC;
}
/* RC Bin Overflow */
#zoneTable tbody td:nth-child(8),
#zoneTable tbody td:nth-child(9),
#zoneTable tbody td:nth-child(10) {
#zoneTable tbody td:nth-child(10),
#zoneTable tbody td:nth-child(11),
#zoneTable tbody td:nth-child(12),
#zoneTable tbody td:nth-child(13) {
background-color: #f8f9fa;
}
/* Unauthorized Garbage Dumping - Dark */
#zoneTable tbody td:nth-child(11),
#zoneTable tbody td:nth-child(12),
#zoneTable tbody td:nth-child(13) {
#zoneTable tbody td:nth-child(14),
#zoneTable tbody td:nth-child(15),
#zoneTable tbody td:nth-child(16),
#zoneTable tbody td:nth-child(17) {
background-color: #E1ECFC;
}
/* Tenement */
#zoneTable tbody td:nth-child(14),
#zoneTable tbody td:nth-child(15),
#zoneTable tbody td:nth-child(16) {
#zoneTable tbody td:nth-child(18),
#zoneTable tbody td:nth-child(19),
#zoneTable tbody td:nth-child(20),
#zoneTable tbody td:nth-child(21) {
background-color: #f8f9fa;
}
@ -275,27 +443,27 @@
<th rowspan="2" class="text-center align-middle">
Zone
</th>
<th colspan="3" class="text-center">
<th colspan="4" class="text-center">
Sweeping
</th>
<!-- Garbage -->
<th colspan="3" class="text-center">
<th colspan="4" class="text-center">
Hotspot
</th>
<!-- Hotspot -->
<th colspan="3" class="text-center">
<th colspan="4" class="text-center">
RC Bin Overflow
</th>
<!-- Transport -->
<th colspan="3" class="text-center">
<th colspan="4" class="text-center">
Unauthorized garbage dumping
</th>
<!-- Tenement -->
<th colspan="3" class="text-center">
<th colspan="4" class="text-center">
Tenement
</th>
@ -306,27 +474,32 @@
<!-- Sweeping -->
<th class="text-center">Complaints</th>
<th class="text-center">Completed</th>
<th class="text-center">Pending</th>
<th class="text-center">Vendor Pending</th>
<th class="text-center">IE Pending</th>
<!-- Garbage -->
<th class="text-center">Complaints</th>
<th class="text-center">Completed</th>
<th class="text-center">Pending</th>
<th class="text-center">Vendor Pending</th>
<th class="text-center">IE Pending</th>
<!-- Hotspot -->
<th class="text-center">Complaints</th>
<th class="text-center">Completed</th>
<th class="text-center">Pending</th>
<th class="text-center">Vendor Pending</th>
<th class="text-center">IE Pending</th>
<!-- Transport -->
<th class="text-center">Complaints</th>
<th class="text-center">Completed</th>
<th class="text-center">Pending</th>
<th class="text-center">Vendor Pending</th>
<th class="text-center">IE Pending</th>
<!-- Tenement -->
<th class="text-center">Complaints</th>
<th class="text-center">Completed</th>
<th class="text-center">Pending</th>
<th class="text-center">Vendor Pending</th>
<th class="text-center">IE Pending</th>
</tr>
@ -1067,32 +1240,36 @@ ${(
<td>${s.total_count || 0}</td>
<td>${s.completed_count || 0}</td>
<td>${s.pending_count || 0}</td>
<td>${s.vendor_pending_count || 0}</td>
<td>${s.ie_pending_count || 0}</td>
<!-- HOTSPOT -->
<td>${h.total_count || 0}</td>
<td>${h.completed_count || 0}</td>
<td>${h.pending_count || 0}</td>
<td>${h.vendor_pending_count || 0}</td>
<td>${h.ie_pending_count || 0}</td>
<!-- TRANSPORT -->
<td>${t.total_count || 0}</td>
<td>${t.completed_count || 0}</td>
<td>${t.pending_count || 0}</td>
<td>${t.vendor_pending_count || 0}</td>
<td>${t.ie_pending_count || 0}</td>
<!-- GARBAGE -->
<td>${g.total_count || 0}</td>
<td>${g.completed_count || 0}</td>
<td>${g.pending_count || 0}</td>
<td>${g.vendor_pending_count || 0}</td>
<td>${g.ie_pending_count || 0}</td>
<!-- TENEMENT -->
<td>${ten.total || 0}</td>
<td>${ten.completed || 0}</td>
<td>${ten.pending || 0}</td>
<td>${ten.total_complaint_pending_count || 0}</td>
<td>${ten.total_complaint_ie_pending_count || 0}</td>
</tr>
`;
});
@ -2853,7 +3030,7 @@ ${w.ward}
/*<div class="col-md-4 mb-4">*/
html += `
<div class="col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4 mb-4">
<!--<div class="col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4 mb-4">
<div class="card complaint-card">
<div class="card-header complaint-header">
${item.complaint_id == 6
@ -2864,9 +3041,9 @@ ${w.ward}
}
</div>
<!--<div class="card-header complaint-header">
<div class="card-header complaint-header">
${item.complaint_name}
</div>-->
</div>
<div class="card-body text-center">
@ -2888,9 +3065,78 @@ ${w.ward}
<div class="col-4">
<div class="summary-box pending">
<p>Pending</p>
<p>Vendor Pending</p>
<h4>${item.pending_count}</h4>
</div>
</div>
<div class="col-4">
<div class="summary-box pending">
<p>IE Pending</p>
<h4>${item.ie_pending_count}</h4>
</div>
</div>
</div>
</div>
</div>
</div>-->
<div class="col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4 mb-4">
<div class="card complaint-card">
<div class="card-header complaint-header">
${item.complaint_id == 6
? 'RC Bin Overflow'
: item.complaint_id == 12
? 'Unauthorized garbage dumping'
: item.complaint_name
}
</div>
<div class="card-body">
<!-- First Row -->
<div class="row mb-2">
<div class="col-6">
<div class="summary-box total">
<p>Total</p>
<!-- <h4>${Number(item.completed_count) + Number(item.pending_count)}</h4>-->
<h4>${item.total_count}</h4>
</div>
</div>
<div class="col-6">
<div class="summary-box completed">
<p>Completed</p>
<h4>${item.completed_count}</h4>
</div>
</div>
</div>
<!-- Pending Section -->
<div class="pending-summary-box">
<div class="pending-title">
Pending
</div>
<div class="pending-content">
<div class="pending-item">
<p>Vendor Pending</p>
<h4>${item.pending_count}</h4>
</div>
<div class="pending-divider"></div>
<div class="pending-item">
<p>IE Pending</p>
<h4>${item.ie_pending_count}</h4>
</div>
</div>
</div>
@ -2899,6 +3145,7 @@ ${w.ward}
</div>
</div>
`;
});
@ -2925,7 +3172,7 @@ ${w.ward}
let tenementHtml = `
<div class="col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4 mb-4">
<!--<div class="col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4 mb-4">
<div class="card complaint-card">
@ -2951,11 +3198,75 @@ ${w.ward}
</div>
</div>
<div class="col-4">
<div class="summary-box pending">
<p>Pending</p>
<p>Vendor Pending</p>
<h4>${item.pending_count}</h4>
</div>
</div>
<div class="col-4">
<div class="summary-box pending">
<p>IE Pending</p>
<h4>${item.ie_pending_count}</h4>
</div>
</div>
</div>
</div>
</div>
</div>-->
<div class="col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4 mb-4">
<div class="card complaint-card">
<div class="card-header complaint-header">
${item.complaint_name}
</div>
<div class="card-body">
<!-- First Row -->
<div class="row mb-2">
<div class="col-6">
<div class="summary-box total">
<p>Total</p>
<h4>${item.total_count}</h4>
</div>
</div>
<div class="col-6">
<div class="summary-box completed">
<p>Completed</p>
<h4>${item.completed_count}</h4>
</div>
</div>
</div>
<!-- Pending Row -->
<div class="pending-box">
<div class="pending-title">
Pending
</div>
<div class="pending-content">
<div class="pending-item">
<p>Vendor Pending</p>
<h4>${item.pending_count}</h4>
</div>
<div class="pending-divider"></div>
<div class="pending-item">
<p>IE Pending</p>
<h4>${item.ie_pending_count}</h4>
</div>
</div>
@ -2965,6 +3276,9 @@ ${w.ward}
</div>
</div>
</div>
`;
$("#dashboardCards").append(tenementHtml);

Loading…
Cancel
Save