10 KiB
10 KiB
Stoppages Analysis Feature
Overview
Created a comprehensive stoppages analysis page that aggregates and displays all operational stoppages from report sheets. This provides valuable insights into operational efficiency, downtime patterns, and areas for improvement.
Features
✅ Comprehensive Data Analysis
- All Stoppages: Shows stoppages from both day and night shifts across all report sheets
- Detailed Information: Displays time, reason, responsible party, and notes for each stoppage
- Summary Statistics: Provides overall metrics and averages
- Filtering: Multiple filter options for focused analysis
- Time Calculations: Automatic time aggregation and formatting
✅ Summary Statistics Dashboard
- Total Stoppages: Count of all stoppage incidents
- Total Time: Sum of all stoppage durations
- Sheets with Stoppages: Number of sheets that have recorded stoppages
- Average Stoppages per Sheet: Mean number of stoppages per sheet
- Average Time per Sheet: Mean stoppage duration per sheet
✅ Filter Options
- Date Range: From/To date filtering
- Area: Filter by operational area
- Employee: Filter by specific employee
- Dredger Location: Filter by dredger location
- Real-time Filtering: Immediate results update
User Interface
✅ Statistics Dashboard
┌─────────────────────────────────────────────────────────────┐
│ Stoppages Summary - Overall statistics for selected period │
├─────────────────────────────────────────────────────────────┤
│ [45] [12:30] [15] [3.0] [00:50] │
│ Total Total Sheets Avg/Sheet Avg Time │
│ Stoppages Time w/Stops /Sheet │
└─────────────────────────────────────────────────────────────┘
✅ Detailed Stoppages Table
- Date & Shift: When the stoppages occurred
- Location: Area, dredger, and reclamation locations
- Employee: Who reported the stoppages
- Stoppages: Detailed breakdown of each stoppage
- Total Time: Aggregated time for all stoppages in that shift
✅ Mobile-Responsive Design
- Desktop: Full table with detailed columns
- Mobile: Card-based layout with collapsible details
- Responsive Filters: Adapts to screen size
Technical Implementation
✅ Data Processing
// Process stoppages from both day and night shifts
sheets.forEach(sheet => {
// Day shift stoppages
if (sheet.dayShift && Array.isArray(sheet.dayShift.stoppages)) {
const stoppages = sheet.dayShift.stoppages as StoppageEntry[];
const totalTime = stoppages.reduce((sum, stoppage) =>
sum + timeToMinutes(stoppage.total), 0);
// Add to stoppagesData array
}
// Night shift stoppages (similar processing)
});
✅ Time Calculations
// Convert time string to minutes for calculations
const timeToMinutes = (timeStr: string): number => {
if (!timeStr || timeStr === '00:00') return 0;
const [hours, minutes] = timeStr.split(':').map(Number);
return (hours * 60) + minutes;
};
// Format minutes back to HH:MM display
const formatMinutesToTime = (minutes: number): string => {
const hours = Math.floor(minutes / 60);
const mins = minutes % 60;
return `${hours.toString().padStart(2, '0')}:${mins.toString().padStart(2, '0')}`;
};
✅ Filtering Logic
- Server-side: Initial filtering by date, area, and location
- Post-processing: Employee filtering after data aggregation
- URL Persistence: Filters maintained in URL parameters
- Real-time Updates: Immediate filter application
Data Structure
✅ Stoppage Entry
interface StoppageEntry {
id: string;
from: string; // Start time
to: string; // End time
total: string; // Duration (HH:MM)
reason: string; // Reason for stoppage
responsible: string; // Who/what was responsible
note: string; // Additional notes
}
✅ Processed Data
interface StoppageData {
sheetId: number;
date: string;
area: string;
dredgerLocation: string;
reclamationLocation: string;
shift: string; // 'Day' or 'Night'
employee: string;
stoppages: StoppageEntry[];
totalStoppageTime: number; // Total minutes
}
Business Value
✅ Operational Insights
- Downtime Analysis: Identify patterns in operational stoppages
- Efficiency Metrics: Track overall operational efficiency
- Problem Areas: Identify locations or shifts with frequent stoppages
- Responsibility Tracking: See who/what causes most stoppages
- Trend Analysis: Monitor improvements over time
✅ Management Benefits
- Performance Monitoring: Track operational performance metrics
- Resource Planning: Identify areas needing attention or resources
- Cost Analysis: Understand the impact of downtime
- Process Improvement: Data-driven decisions for optimization
- Reporting: Comprehensive stoppage reports for stakeholders
Use Cases
Operational Analysis
- Daily Review: Check yesterday's stoppages and their causes
- Weekly Trends: Analyze patterns over the past week
- Area Comparison: Compare stoppage rates between different areas
- Shift Analysis: Compare day vs night shift performance
- Employee Performance: Track individual performance metrics
Management Reporting
- Monthly Reports: Generate monthly stoppage summaries
- Efficiency Metrics: Calculate operational efficiency percentages
- Cost Impact: Estimate financial impact of stoppages
- Improvement Tracking: Monitor the effectiveness of improvements
- Benchmarking: Compare performance across different periods
Process Improvement
- Root Cause Analysis: Identify most common stoppage reasons
- Prevention Planning: Plan preventive measures based on data
- Resource Allocation: Allocate resources to problem areas
- Training Needs: Identify training needs based on stoppage patterns
- Equipment Maintenance: Schedule maintenance based on stoppage data
Statistics Calculations
✅ Summary Metrics
- Total Stoppages: Sum of all individual stoppage incidents
- Total Time: Sum of all stoppage durations (converted to HH:MM)
- Sheets with Stoppages: Count of unique sheets that have stoppages
- Average Stoppages per Sheet: Total stoppages ÷ sheets with stoppages
- Average Time per Sheet: Total time ÷ sheets with stoppages
✅ Time Aggregation
- Individual stoppage times are converted to minutes for calculation
- Totals are calculated in minutes for accuracy
- Results are converted back to HH:MM format for display
- Proper handling of time across midnight boundaries
Performance Considerations
✅ Efficient Data Processing
- Single database query to fetch all relevant sheets
- In-memory processing of JSON stoppage data
- Efficient filtering and aggregation algorithms
- Minimal data transfer with focused queries
✅ Scalability
- Indexed date fields for fast date range queries
- Efficient JSON processing for stoppage data
- Pagination could be added for very large datasets
- Caching opportunities for frequently accessed data
Future Enhancements
Advanced Analytics
- Charts and Graphs: Visual representation of stoppage trends
- Comparative Analysis: Compare periods, areas, or employees
- Predictive Analytics: Predict potential stoppage patterns
- Export Functionality: Export data to Excel or PDF
- Automated Alerts: Notify when stoppages exceed thresholds
Enhanced Filtering
- Stoppage Reason: Filter by specific stoppage reasons
- Time Range: Filter by time of day when stoppages occurred
- Duration Range: Filter by stoppage duration (short vs long)
- Responsible Party: Filter by who was responsible
- Multiple Selection: Select multiple areas, employees, etc.
Integration Features
- Dashboard Integration: Add stoppage widgets to main dashboard
- Report Integration: Link to related reports and sheets
- Notification System: Alert management about critical stoppages
- API Endpoints: Provide data for external systems
- Mobile App: Dedicated mobile interface for field use
Counted vs Uncounted Stoppages
✅ Classification Logic
- Counted Stoppages: Unplanned operational stoppages that impact productivity
- Uncounted Stoppages: Planned operational activities that don't count as downtime
- Entries containing "Brine" in reason or notes (planned brine operations)
- Entries containing "Change Shift" in reason or notes (planned shift changes)
✅ Visual Indicators
- Red Background: Counted stoppages (impact productivity)
- Green Background: Uncounted stoppages (planned activities)
- Color-coded Badges: "Counted" (red) vs "Uncounted" (green)
- Legend: Clear explanation of the classification system
✅ Enhanced Statistics
- Total vs Counted: Shows both total and counted stoppage counts
- Time Breakdown: Separate time calculations for counted vs uncounted
- Percentage Analysis: Shows what percentage of stoppages are counted
- Averages: Separate averages for total and counted stoppages per sheet
Menu Integration
✅ Dashboard Navigation
- Added "Stoppages" menu item to the main navigation
- Accessible to users with auth level 2+ (management and admin)
- Clock icon for easy identification
- Consistent with other navigation items
The stoppages analysis feature provides comprehensive insights into operational efficiency and helps identify areas for improvement, making it a valuable tool for operational management and continuous improvement initiatives. The counted vs uncounted classification ensures that only genuine operational stoppages are considered in productivity metrics."