feat: implement AdminController with dashboard caching, data management, and autocomplete utilities
This commit is contained in:
@@ -1,190 +0,0 @@
|
||||
# Test Package Cleanup - SQL Error Fix
|
||||
|
||||
## Problem Summary
|
||||
SQL syntax error occurred when trying to delete records with empty `test_package_no` values:
|
||||
```
|
||||
SQLSTATE[42000]: Syntax error near '' at line 1
|
||||
WHERE (`test_package_no` = '' or `test_package_no` is null)
|
||||
```
|
||||
|
||||
## What Was Fixed
|
||||
|
||||
### 1. Enhanced Error Handling
|
||||
- ✅ Added comprehensive try-catch in `weld_logs.php` SaveTrigger
|
||||
- ✅ Made cleanup operation non-critical (won't break main flow)
|
||||
- ✅ Added detailed error logging
|
||||
|
||||
### 2. Integrated Cleanup System
|
||||
**File:** `resources/views/cron/weld_logs-delete-non-matching-test-pack-statuses.blade.php`
|
||||
|
||||
**Now includes TWO cleanup sections:**
|
||||
|
||||
#### **SECTION 1: Empty Records Cleanup (NEW)**
|
||||
- ✅ Automatically deletes empty/null `test_package_number` records
|
||||
- ✅ Automatically deletes empty/null `test_package_no` and `drawing_no` records
|
||||
- ✅ Runs on every SaveTrigger execution (continuous cleanup)
|
||||
|
||||
#### **SECTION 2: Non-Matching Records Cleanup (EXISTING)**
|
||||
- ✅ Deletes records not present in `weld_logs`
|
||||
- ✅ Added null and empty string validation
|
||||
- ✅ Array filtering before deletion
|
||||
|
||||
**Before:**
|
||||
```sql
|
||||
-- Two separate scripts needed
|
||||
WHERE (`test_package_no` = '' or `test_package_no` is null) -- ERROR!
|
||||
```
|
||||
|
||||
**After:**
|
||||
```sql
|
||||
-- Single integrated script
|
||||
SECTION 1: DELETE empty records first
|
||||
SECTION 2: DELETE non-matching records (with proper validation)
|
||||
```
|
||||
|
||||
### 3. Simplified Architecture
|
||||
- ❌ **Removed:** `cleanup-empty-test-package-numbers.blade.php` (redundant)
|
||||
- ❌ **Removed:** `admin-ajax/cleanup-empty-test-packages.blade.php` (redundant)
|
||||
- ✅ **Single Source:** All cleanup in one place, runs automatically
|
||||
|
||||
## How to Use
|
||||
|
||||
### Step 1: Clear Cache and Restart Queue
|
||||
|
||||
```bash
|
||||
php artisan cache:clear
|
||||
php artisan config:clear
|
||||
php artisan queue:clear
|
||||
php artisan queue:restart
|
||||
```
|
||||
|
||||
### Step 2: Test the Fix
|
||||
|
||||
**Edit any weld_log record:**
|
||||
- The cleanup will run automatically via SaveTrigger
|
||||
- Check logs: `tail -f storage/logs/laravel.log`
|
||||
- Should see: "Test pack cleanup completed successfully"
|
||||
|
||||
### Step 3: Monitor Logs
|
||||
|
||||
**Success indicators:**
|
||||
```
|
||||
[INFO] Deleted empty test_package_number records: 5
|
||||
[INFO] Deleted empty field records: 12
|
||||
[INFO] Deleting non-matching test packages: 3
|
||||
[INFO] Test pack cleanup completed successfully
|
||||
- empty_test_packages_deleted: 5
|
||||
- empty_base_statuses_deleted: 12
|
||||
- non_matching_test_packages_deleted: 3
|
||||
- non_matching_base_statuses_deleted: 8
|
||||
- total_deleted: 28
|
||||
```
|
||||
|
||||
**If errors occur (now handled gracefully):**
|
||||
```
|
||||
[ERROR] Test pack non-matching records cleanup failed (non-critical)
|
||||
[ERROR] Error in weld_logs-delete-non-matching-test-pack-statuses
|
||||
```
|
||||
|
||||
## Key Improvements
|
||||
|
||||
### Data Validation
|
||||
- ✅ Empty strings are now filtered out
|
||||
- ✅ NULL values are excluded
|
||||
- ✅ ID validation for base statuses (must be numeric and > 0)
|
||||
|
||||
### Error Handling
|
||||
- ✅ Non-breaking errors (job continues even if cleanup fails)
|
||||
- ✅ Detailed error logging with stack traces
|
||||
- ✅ Informative success/failure messages
|
||||
|
||||
### Performance
|
||||
- ✅ Batch filtering before deletion
|
||||
- ✅ Efficient array_filter usage
|
||||
- ✅ Proper indexing usage
|
||||
|
||||
## Expected Results
|
||||
|
||||
**Automatic cleanup runs on every weld_log update:**
|
||||
- Empty records deleted immediately
|
||||
- Non-matching records deleted immediately
|
||||
- No manual intervention needed
|
||||
- Logs show detailed breakdown
|
||||
|
||||
## How It Works
|
||||
|
||||
### Automatic Cleanup Flow:
|
||||
```
|
||||
User edits weld_log record
|
||||
↓
|
||||
SaveTrigger executes
|
||||
↓
|
||||
delete-non-matching script runs
|
||||
↓
|
||||
SECTION 1: Delete empty records ✓
|
||||
↓
|
||||
SECTION 2: Delete non-matching records ✓
|
||||
↓
|
||||
Cleanup completed (logged)
|
||||
↓
|
||||
Job continues normally ✓
|
||||
```
|
||||
|
||||
### Prevention Mechanisms:
|
||||
1. **Automatic:** Runs on every SaveTrigger execution
|
||||
2. **Comprehensive:** Handles both empty and non-matching records
|
||||
3. **Safe:** Validates data before deletion
|
||||
4. **Non-breaking:** Errors don't stop the main flow
|
||||
5. **Logged:** Detailed logging for monitoring
|
||||
|
||||
## Files Modified
|
||||
|
||||
### Modified:
|
||||
1. `/app/Http/Controllers/SaveTrigger/weld_logs.php`
|
||||
- Enhanced error handling around cleanup call
|
||||
- Non-breaking error handling
|
||||
|
||||
2. `/resources/views/cron/weld_logs-delete-non-matching-test-pack-statuses.blade.php`
|
||||
- **SECTION 1 (NEW):** Empty records cleanup
|
||||
- **SECTION 2 (ENHANCED):** Non-matching records cleanup with validation
|
||||
- Comprehensive logging
|
||||
- Array filtering
|
||||
|
||||
### Removed (No longer needed):
|
||||
1. ~~`/resources/views/cron/cleanup-empty-test-package-numbers.blade.php`~~
|
||||
- Functionality integrated into delete-non-matching script
|
||||
|
||||
2. ~~`/resources/views/admin-ajax/cleanup-empty-test-packages.blade.php`~~
|
||||
- No longer needed, cleanup is automatic
|
||||
|
||||
## Verification Commands
|
||||
|
||||
**Check for empty test_package_no:**
|
||||
```sql
|
||||
-- Test Packages
|
||||
SELECT COUNT(*) FROM test_packages
|
||||
WHERE (test_package_number = '' OR test_package_number IS NULL);
|
||||
|
||||
-- Base Statuses
|
||||
SELECT COUNT(*) FROM test_pack_base_statuses
|
||||
WHERE (test_package_no = '' OR test_package_no IS NULL);
|
||||
```
|
||||
|
||||
**After cleanup, these should return 0.**
|
||||
|
||||
## Support
|
||||
|
||||
If issues persist, check logs with:
|
||||
```bash
|
||||
# Filter for test pack errors
|
||||
tail -f storage/logs/laravel.log | grep -i "test.pack\|cleanup"
|
||||
|
||||
# Check job failures
|
||||
tail -f storage/logs/laravel.log | grep -i "ExecuteSaveTriggerJob\|timeout"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Last Updated:** October 16, 2025
|
||||
**Status:** ✅ Fixed and Tested
|
||||
|
||||
@@ -1,948 +0,0 @@
|
||||
# Construction Dashboards Implementation Report
|
||||
|
||||
**Branch:** `Construction-Dashboards-Charts-271025`
|
||||
**Date:** October 30, 2025
|
||||
**Commit:** 28110f5f0
|
||||
|
||||
---
|
||||
|
||||
## 📋 Executive Summary
|
||||
|
||||
This implementation enhanced three performance dashboard tables (Welder, Zone, and Crew Performance) with new features including year filtering, total WDI calculations, summary footers, and Excel export functionality with color-coded cells.
|
||||
|
||||
**Total Changes:**
|
||||
- 3 files modified
|
||||
- 564 lines inserted
|
||||
- 198 lines deleted
|
||||
- 20+ features added
|
||||
- 10+ bugs fixed
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Completed Features
|
||||
|
||||
### 1. Welder Performance Table
|
||||
|
||||
#### A) Year Filter Enhancement
|
||||
**Problem:** Filter was too small and hard to see
|
||||
**Solution:** Enhanced visibility with white label, icon, and larger font
|
||||
|
||||
**Changes:**
|
||||
```html
|
||||
<!-- Before -->
|
||||
<select style="width: 100px;">
|
||||
|
||||
<!-- After -->
|
||||
<div style="position: absolute; right: 14px; top: 8px;">
|
||||
<label style="color:#fff; font-size:14px; font-weight:bold;">
|
||||
<i class="fa fa-calendar"></i> Year:
|
||||
</label>
|
||||
<select style="width: 110px; font-size:14px; font-weight:bold; border: 2px solid #3498db;">
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php` (Line 14-23)
|
||||
|
||||
---
|
||||
|
||||
#### B) Total WDI Column
|
||||
**Purpose:** Show annual total WDI for each welder (sum of all 12 months)
|
||||
|
||||
**Backend Calculation:**
|
||||
```php
|
||||
// Calculate year_total_wdi from monthly sums
|
||||
$yearTotal = 0;
|
||||
for($i = 1; $i <= 12; $i++) {
|
||||
$yearTotal += isset($refactor[$welder]['welder_wdi_' . $i]) ?
|
||||
$refactor[$welder]['welder_wdi_' . $i] : 0;
|
||||
}
|
||||
$refactor[$welder]['year_total_wdi'] = round($yearTotal, 2);
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin-ajax/welder-performance.blade.php` (Line 119-123)
|
||||
|
||||
**Frontend Column:**
|
||||
```javascript
|
||||
{
|
||||
dataField: "year_total_wdi",
|
||||
caption: "Total WDI",
|
||||
dataType: "number",
|
||||
format: {
|
||||
type: "fixedPoint",
|
||||
precision: 2
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php` (Line 57-65)
|
||||
|
||||
**Position:** After "Avg" column, before monthly columns
|
||||
|
||||
---
|
||||
|
||||
#### C) AVG Calculation Fix
|
||||
**Problem:** AVG was calculated by dividing by number of active months only
|
||||
**Solution:** Changed to divide by 12 (full year average)
|
||||
|
||||
**Before (Incorrect):**
|
||||
```php
|
||||
// Only counted months with data
|
||||
$count = 0;
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
if (isset($welderData[$key])) {
|
||||
$sum += $welderData[$key];
|
||||
$count++; // Only increment if month has data
|
||||
}
|
||||
}
|
||||
return $count > 0 ? round($sum / $count, 2) : 0;
|
||||
```
|
||||
**Example:** Jan:50, Feb:60, rest empty → AVG = (50+60)/2 = 55 ❌
|
||||
|
||||
**After (Correct):**
|
||||
```php
|
||||
// Always divide by 12
|
||||
$sum = 0;
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$sum += isset($welderData[$key]) ? $welderData[$key] : 0;
|
||||
}
|
||||
return round($sum / 12, 2);
|
||||
```
|
||||
**Example:** Jan:50, Feb:60, rest:0 → AVG = (50+60+0+...)/12 = 9.17 ✅
|
||||
|
||||
**File:** `resources/views/admin-ajax/welder-performance.blade.php` (Line 117-124)
|
||||
|
||||
---
|
||||
|
||||
#### D) W Column - WDI Indicators
|
||||
**Purpose:** Show WDI increase/decrease with color and arrow
|
||||
|
||||
**Backend Logic:**
|
||||
```php
|
||||
for($month = 1; $month <= 12; $month++) {
|
||||
$currentWDI = $refactor[$welder]['welder_wdi_' . $month] ?? 0;
|
||||
$previousWDI = $refactor[$welder]['welder_wdi_' . ($month - 1)] ?? 0;
|
||||
|
||||
if($previousWDI < $currentWDI) {
|
||||
$wdiChange = "up"; // Green arrow
|
||||
} elseif($previousWDI > $currentWDI) {
|
||||
$wdiChange = "down"; // Red arrow
|
||||
} else {
|
||||
$wdiChange = "equal"; // Yellow equal sign
|
||||
}
|
||||
$refactor[$welder]['welder_wdi_' . $month . '_change'] = $wdiChange;
|
||||
}
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin-ajax/welder-performance.blade.php` (Line 138-145)
|
||||
|
||||
**Frontend Display:**
|
||||
```javascript
|
||||
cellTemplate: function(container, options) {
|
||||
var wdiValue = options.data['welder_wdi_{{$k}}'] || 0;
|
||||
var changeValue = options.data['welder_wdi_{{$k}}_change'];
|
||||
var arrowIcon = changeValue === 'up' ? 'chevronup' :
|
||||
(changeValue === 'down' ? 'chevrondown' : 'equal');
|
||||
var color = changeValue === 'up' ? 'success' :
|
||||
(changeValue === 'down' ? 'danger' : 'warning');
|
||||
|
||||
container.html(parseFloat(wdiValue).toFixed(2) +
|
||||
'<div style="position:absolute;top:8px;right:-3px" class="dx-icon text-' +
|
||||
color +' dx-icon-'+arrowIcon+'"></div>');
|
||||
container.addClass("table-" + color).addClass("position-relative");
|
||||
}
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php` (Line 76-84)
|
||||
|
||||
**Colors:**
|
||||
- 🟢 Green: WDI increased (good)
|
||||
- 🔴 Red: WDI decreased (bad)
|
||||
- 🟡 Yellow: No change
|
||||
|
||||
---
|
||||
|
||||
#### E) % Column - WDI Growth Percentage
|
||||
**Problem:** Was showing repair rate (confusing)
|
||||
**Solution:** Changed to show WDI growth percentage
|
||||
|
||||
**Old Formula (Repair Rate):**
|
||||
```sql
|
||||
% = (Repair WDI / Normal WDI) × 100
|
||||
```
|
||||
**Meaning:** What percentage of welds were repairs?
|
||||
|
||||
**New Formula (Growth Percentage):**
|
||||
```php
|
||||
if($previousWDI > 0) {
|
||||
$growthPercent = round((($currentWDI - $previousWDI) / $previousWDI) * 100, 2);
|
||||
} else {
|
||||
$growthPercent = 0;
|
||||
}
|
||||
```
|
||||
**Meaning:** How much did WDI increase/decrease compared to last month?
|
||||
|
||||
**File:** `resources/views/admin-ajax/welder-performance.blade.php` (Line 130-135)
|
||||
|
||||
**Examples:**
|
||||
```
|
||||
Jan: 214 → %: 0 (no previous month)
|
||||
Feb: 224 → %: +4.67 ((224-214)/214×100)
|
||||
Mar: 599.5 → %: +167.63 ((599.5-224)/224×100)
|
||||
```
|
||||
|
||||
**Display:**
|
||||
```javascript
|
||||
var displayValue = parseFloat(percentValue).toFixed(2);
|
||||
if(percentValue > 0) displayValue = '+' + displayValue; // Add + sign
|
||||
```
|
||||
|
||||
**Colors:**
|
||||
- 🟢 Green: Positive growth (good)
|
||||
- 🔴 Red: Negative growth (bad)
|
||||
- 🟡 Yellow: No change
|
||||
|
||||
---
|
||||
|
||||
#### F) Summary Footer
|
||||
**Purpose:** Show totals at bottom of table
|
||||
|
||||
**Implemented Summaries:**
|
||||
- Welder count: "Total: X welders"
|
||||
- Year Total WDI: Sum + Avg
|
||||
- Each month W column: Sum + Avg
|
||||
- Each month % column: Avg
|
||||
|
||||
**Total:** 39 summary items (1 count + 2 year total + 24 monthly W + 12 monthly %)
|
||||
|
||||
**Code:**
|
||||
```javascript
|
||||
summary: {
|
||||
totalItems: [
|
||||
{
|
||||
column: "welder",
|
||||
summaryType: "count",
|
||||
displayFormat: "Total: {0} welders"
|
||||
},
|
||||
{
|
||||
column: "year_total_wdi",
|
||||
summaryType: "sum",
|
||||
valueFormat: { type: "fixedPoint", precision: 2 }
|
||||
},
|
||||
// ... 37 more items
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php` (Line 178-210)
|
||||
|
||||
**Precision:** All decimal values show 2 decimal places
|
||||
|
||||
---
|
||||
|
||||
#### G) Excel Export with Color Coding
|
||||
**Purpose:** Export with visual indicators preserved
|
||||
|
||||
**Implementation:**
|
||||
```javascript
|
||||
onExporting: function(e) {
|
||||
const workbook = new ExcelJS.Workbook();
|
||||
const worksheet = workbook.addWorksheet('Welder Performance');
|
||||
|
||||
DevExpress.excelExporter.exportDataGrid({
|
||||
component: e.component,
|
||||
worksheet: worksheet,
|
||||
autoFilterEnabled: true,
|
||||
customizeCell: function(options) {
|
||||
const excelCell = options.excelCell;
|
||||
const gridCell = options.gridCell;
|
||||
|
||||
if(gridCell.rowType === 'data' && gridCell.column.dataField) {
|
||||
const value = parseFloat(gridCell.value || 0);
|
||||
|
||||
// W columns: Light green if value > 0
|
||||
if(gridCell.column.dataField.includes('welder_wdi_')) {
|
||||
if(value > 0) {
|
||||
excelCell.fill = {
|
||||
type: 'pattern',
|
||||
pattern: 'solid',
|
||||
fgColor: { argb: 'FFE8F5E9' }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// % columns: Green for positive, Red for negative
|
||||
if(gridCell.column.dataField.includes('welder_repair_')) {
|
||||
if(value > 0) {
|
||||
excelCell.fill = {
|
||||
type: 'pattern',
|
||||
pattern: 'solid',
|
||||
fgColor: { argb: 'FFD4EDDA' }
|
||||
};
|
||||
excelCell.font = { color: { argb: 'FF155724' } };
|
||||
} else if(value < 0) {
|
||||
excelCell.fill = {
|
||||
type: 'pattern',
|
||||
pattern: 'solid',
|
||||
fgColor: { argb: 'FFF8D7DA' }
|
||||
};
|
||||
excelCell.font = { color: { argb: 'FF721C24' } };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}).then(function() {
|
||||
workbook.xlsx.writeBuffer().then(function(buffer) {
|
||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }),
|
||||
'Welder_Performance_{{$selectedYear}}.xlsx');
|
||||
});
|
||||
});
|
||||
e.cancel = true;
|
||||
}
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php` (Line 128-189)
|
||||
|
||||
**Color Codes:**
|
||||
- `FFE8F5E9`: Very light green (W columns)
|
||||
- `FFD4EDDA`: Light green background (positive %)
|
||||
- `FF155724`: Dark green text (positive %)
|
||||
- `FFF8D7DA`: Light red background (negative %)
|
||||
- `FF721C24`: Dark red text (negative %)
|
||||
|
||||
---
|
||||
|
||||
### 2. Zone Performance Table
|
||||
|
||||
#### A) Area Column Addition
|
||||
**Purpose:** Show design area information next to zone
|
||||
|
||||
**Backend Query:**
|
||||
```php
|
||||
$zoneQuery = db("weld_logs")
|
||||
->select([
|
||||
"project",
|
||||
DB::raw('MAX(design_area) as design_area'), // NEW
|
||||
DB::raw('ROUND(SUM(nps_1), 2) as total'),
|
||||
// ... other fields
|
||||
])
|
||||
->groupBy("project")
|
||||
->get();
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin-ajax/welder-performance.blade.php` (Line 46-60)
|
||||
|
||||
**Frontend Column:**
|
||||
```javascript
|
||||
{
|
||||
dataField: "design_area",
|
||||
caption: "Area",
|
||||
dataType: "string"
|
||||
}
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php` (Line 291-295)
|
||||
|
||||
**Position:** Immediately after "Zone" column
|
||||
|
||||
---
|
||||
|
||||
#### B) Excel Export
|
||||
**Implementation:** Standard DevExtreme export without color coding
|
||||
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php` (Line 551-569)
|
||||
|
||||
---
|
||||
|
||||
#### C) Bug Fixes
|
||||
**Issues Fixed:**
|
||||
1. String to number conversion (`parseFloat()` added to all `customizeText`)
|
||||
2. Removed unsafe `eval()` calls in `calculateCellValue` functions
|
||||
3. Fixed data binding with `dataSource: []` initialization
|
||||
4. Added `.refresh()` call after setting dataSource
|
||||
|
||||
**Example Fix:**
|
||||
```javascript
|
||||
// Before (Crashed)
|
||||
customizeText: function(cellInfo) {
|
||||
return cellInfo.value.toFixed(2); // ❌ String doesn't have .toFixed()
|
||||
}
|
||||
|
||||
// After (Works)
|
||||
customizeText: function(cellInfo) {
|
||||
return cellInfo.value ? parseFloat(cellInfo.value).toFixed(2) : '0.00'; // ✅
|
||||
}
|
||||
```
|
||||
|
||||
**Files:**
|
||||
- `resources/views/admin/type/welder-performance.blade.php` (Multiple locations)
|
||||
|
||||
---
|
||||
|
||||
### 3. Crew Performance
|
||||
|
||||
#### A) Data Restructuring
|
||||
**Old Approach:** Simple query returning raw data
|
||||
**New Approach:** Monthly aggregation with restructured format
|
||||
|
||||
**Backend Query:**
|
||||
```php
|
||||
$crewQuery = db("weld_logs")
|
||||
->select([
|
||||
"ste_subcontractor",
|
||||
"mechanic_supervisor",
|
||||
DB::raw('MONTH(mechanic_supervisor_control_date) as month'),
|
||||
DB::raw('ROUND(SUM(nps_1), 2) as nps1'),
|
||||
DB::raw('COUNT(*) as joint_count')
|
||||
])
|
||||
->whereYear("mechanic_supervisor_control_date", $year)
|
||||
->whereNotNull("mechanic_supervisor")
|
||||
->whereNotNull("mechanic_supervisor_control_date")
|
||||
->groupBy("ste_subcontractor", "mechanic_supervisor",
|
||||
DB::raw('MONTH(mechanic_supervisor_control_date)'))
|
||||
->get();
|
||||
|
||||
// Restructure to DataGrid format
|
||||
foreach($crewQuery as $row) {
|
||||
$crewData[$key]['month_' . $row->month . '_nps1'] = $row->nps1;
|
||||
$crewData[$key]['month_' . $row->month . '_count'] = $row->joint_count;
|
||||
}
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin-ajax/crew-performance.blade.php` (Complete rewrite)
|
||||
|
||||
**Output Format:**
|
||||
```json
|
||||
[
|
||||
{
|
||||
"ste_subcontractor": "ABC Corp",
|
||||
"mechanic_supervisor": "John Doe",
|
||||
"month_1_nps1": 125.50,
|
||||
"month_1_count": 15,
|
||||
"month_2_nps1": 180.00,
|
||||
"month_2_count": 20,
|
||||
...
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### B) Simple View (Default)
|
||||
**Structure:**
|
||||
- X-axis: 12 months (January-December)
|
||||
- Y-axis: Teams (Subcontractor → Team Leader)
|
||||
- Each month: 2 columns (NPS1 + Count)
|
||||
|
||||
**Columns:**
|
||||
```javascript
|
||||
columns: [
|
||||
{
|
||||
dataField: "ste_subcontractor",
|
||||
caption: "Subcontractor",
|
||||
groupIndex: 0 // Group by subcontractor
|
||||
},
|
||||
{
|
||||
dataField: "mechanic_supervisor",
|
||||
caption: "Team Leader"
|
||||
},
|
||||
// For each month:
|
||||
{
|
||||
caption: "January",
|
||||
columns: [
|
||||
{ dataField: "month_1_nps1", caption: "NPS1" },
|
||||
{ dataField: "month_1_count", caption: "Count" }
|
||||
]
|
||||
},
|
||||
// ... repeat for 12 months
|
||||
]
|
||||
```
|
||||
|
||||
**Summary:**
|
||||
- Total footer: Sum for each month's NPS1 and Count
|
||||
- Group footer: Sum per subcontractor
|
||||
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php` (Line 750-821)
|
||||
|
||||
---
|
||||
|
||||
#### C) Pivot View (Alternative)
|
||||
**Purpose:** Advanced users can rearrange fields dynamically
|
||||
|
||||
**Features:**
|
||||
- Field Chooser enabled
|
||||
- Dynamic row/column arrangement
|
||||
- Drill-down capability
|
||||
- Cross-tabulation
|
||||
|
||||
**Implementation:**
|
||||
```javascript
|
||||
$("#crewPivotGrid").dxPivotGrid({
|
||||
allowSortingBySummary: true,
|
||||
allowFiltering: true,
|
||||
fieldChooser: {
|
||||
enabled: true,
|
||||
height: 400
|
||||
},
|
||||
dataSource: {
|
||||
fields: [
|
||||
{ dataField: "ste_subcontractor", area: "row" },
|
||||
{ dataField: "mechanic_supervisor", area: "row" },
|
||||
{ dataField: "month", area: "column" },
|
||||
{ dataField: "nps1", area: "data", summaryType: "sum" },
|
||||
{ dataField: "joint_count", area: "data", summaryType: "sum" }
|
||||
]
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php` (Line 823-861)
|
||||
|
||||
---
|
||||
|
||||
#### D) Toggle System
|
||||
**Purpose:** Switch between Simple and Pivot views
|
||||
|
||||
**HTML:**
|
||||
```html
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-primary crew-view-toggle" data-view="simple">
|
||||
Simple View
|
||||
</button>
|
||||
<button class="btn btn-outline-primary crew-view-toggle" data-view="pivot">
|
||||
Pivot View
|
||||
</button>
|
||||
</div>
|
||||
<div id="crewSimpleGrid" style="display:block;"></div>
|
||||
<div id="crewPivotGrid" style="display:none;"></div>
|
||||
```
|
||||
|
||||
**JavaScript:**
|
||||
```javascript
|
||||
$('.crew-view-toggle').on('click', function() {
|
||||
var view = $(this).data('view');
|
||||
|
||||
$('.crew-view-toggle').removeClass('btn-primary').addClass('btn-outline-primary');
|
||||
$(this).removeClass('btn-outline-primary').addClass('btn-primary');
|
||||
|
||||
if(view === 'simple') {
|
||||
$('#crewSimpleGrid').show();
|
||||
$('#crewPivotGrid').hide();
|
||||
} else {
|
||||
$('#crewSimpleGrid').hide();
|
||||
$('#crewPivotGrid').show();
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php` (Line 701-713)
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Technical Improvements
|
||||
|
||||
### 1. ExcelJS Library Integration
|
||||
**Added libraries for Excel export:**
|
||||
```html
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.1.1/exceljs.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.2/FileSaver.min.js"></script>
|
||||
```
|
||||
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php` (Line 7-8)
|
||||
|
||||
**Reason:** DevExtreme 23.1+ requires ExcelJS for client-side export
|
||||
|
||||
---
|
||||
|
||||
### 2. Security Fixes
|
||||
**Removed unsafe eval() usage:**
|
||||
|
||||
**Before:**
|
||||
```javascript
|
||||
calculateCellValue: function(rowData) {
|
||||
return eval(rowData.welded_shop_wdi) + eval(rowData.welded_field_wdi); // ❌
|
||||
}
|
||||
```
|
||||
|
||||
**After:**
|
||||
```javascript
|
||||
calculateCellValue: function(rowData) {
|
||||
return parseFloat(rowData.welded_shop_wdi || 0) +
|
||||
parseFloat(rowData.welded_field_wdi || 0); // ✅
|
||||
}
|
||||
```
|
||||
|
||||
**Files:** `resources/views/admin/type/welder-performance.blade.php` (4 locations)
|
||||
|
||||
---
|
||||
|
||||
### 3. Data Type Conversion
|
||||
**Problem:** Backend returns strings, frontend expects numbers
|
||||
|
||||
**Solution:** Added `parseFloat()` everywhere numbers are used
|
||||
|
||||
**Affected Functions:**
|
||||
- `customizeText` (12 locations)
|
||||
- `calculateCellValue` (4 locations)
|
||||
- `cellTemplate` (24 locations - W and % columns)
|
||||
|
||||
---
|
||||
|
||||
### 4. Code Cleanup
|
||||
**Removed:**
|
||||
- ❌ 6 debug `console.log()` statements
|
||||
- ❌ 3 empty `onEditorPreparing()` functions
|
||||
- ❌ Unnecessary variable declarations
|
||||
|
||||
**Result:** Cleaner, more maintainable code
|
||||
|
||||
---
|
||||
|
||||
## 📊 Data Flow
|
||||
|
||||
### Welder Performance
|
||||
```
|
||||
weld_logs table
|
||||
↓
|
||||
welder-performance.blade.php (AJAX)
|
||||
↓ SQL aggregation
|
||||
↓ Monthly WDI calculation
|
||||
↓ Change indicators
|
||||
↓ JSON output
|
||||
↓
|
||||
welder-performance.blade.php (Frontend)
|
||||
↓ DataGrid rendering
|
||||
↓ Color coding
|
||||
↓ Summary calculations
|
||||
↓
|
||||
User sees table + Excel export
|
||||
```
|
||||
|
||||
### Zone Performance
|
||||
```
|
||||
weld_logs table
|
||||
↓
|
||||
welder-performance.blade.php (AJAX)
|
||||
↓ SQL: GROUP BY project
|
||||
↓ MAX(design_area)
|
||||
↓ SUM aggregations
|
||||
↓
|
||||
DataGrid with Area column
|
||||
↓
|
||||
Excel export
|
||||
```
|
||||
|
||||
### Crew Performance
|
||||
```
|
||||
weld_logs table
|
||||
↓
|
||||
crew-performance.blade.php (AJAX)
|
||||
↓ SQL: GROUP BY supervisor + month
|
||||
↓ Data restructuring (12 months)
|
||||
↓
|
||||
Simple View DataGrid OR Pivot View
|
||||
↓
|
||||
Excel export
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🐛 Issues Fixed
|
||||
|
||||
### Issue 1: Zone Performance showing "No data"
|
||||
**Cause:**
|
||||
1. String values trying to call `.toFixed()` method
|
||||
2. DataGrid not initialized with dataSource
|
||||
3. Missing `.refresh()` call
|
||||
|
||||
**Solution:**
|
||||
1. Added `parseFloat()` to all numeric operations
|
||||
2. Added `dataSource: []` to grid initialization
|
||||
3. Added explicit `.refresh()` after setting dataSource
|
||||
|
||||
---
|
||||
|
||||
### Issue 2: Change indicators not working correctly
|
||||
**Cause:** Using field iteration instead of month sequence
|
||||
|
||||
**Before:**
|
||||
```php
|
||||
foreach($data AS $field => &$value) { // ❌ Field order unpredictable
|
||||
if(strpos($field, "welder_repair_") !== false) {
|
||||
$k++; // Wrong month counter
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**After:**
|
||||
```php
|
||||
for($month = 1; $month <= 12; $month++) { // ✅ Sequential months
|
||||
// Calculate change for this specific month
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Issue 3: W and % columns using same change indicator
|
||||
**Cause:** Both columns referencing `welder_wdi_X_change`
|
||||
|
||||
**Solution:** Created separate indicators:
|
||||
- `welder_wdi_X_change` for W columns
|
||||
- `welder_repair_X_change` for % columns
|
||||
|
||||
---
|
||||
|
||||
### Issue 4: Year Total WDI not matching monthly sum
|
||||
**Cause:** Different filters in separate queries
|
||||
|
||||
**Old Approach:**
|
||||
```php
|
||||
// Separate query with different filter
|
||||
WHERE type_of_welds IN ("BW","FW","SW","TW") // ❌ Not same as monthly
|
||||
```
|
||||
|
||||
**New Approach:**
|
||||
```php
|
||||
// Sum from monthly data
|
||||
$yearTotal = month_1 + month_2 + ... + month_12; // ✅ Guaranteed match
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📁 Files Modified
|
||||
|
||||
### 1. resources/views/admin/type/welder-performance.blade.php
|
||||
**Lines:** 893 (was 548)
|
||||
**Changes:** +345 lines
|
||||
|
||||
**Major sections:**
|
||||
- Year filter UI (Line 14-23)
|
||||
- Welder Performance grid (Line 54-249)
|
||||
- Zone Performance grid (Line 340-568)
|
||||
- Crew Performance (old) grid (Line 251-337)
|
||||
- Crew Performance Simple View (Line 715-822)
|
||||
- Crew Performance Pivot View (Line 824-861)
|
||||
- Toggle system (Line 701-713)
|
||||
|
||||
---
|
||||
|
||||
### 2. resources/views/admin-ajax/welder-performance.blade.php
|
||||
**Lines:** 193 (was 194)
|
||||
**Changes:** Mostly logic fixes
|
||||
|
||||
**Major sections:**
|
||||
- Welder query (Line 5-22)
|
||||
- Crew query (Line 24-41)
|
||||
- Zone query (Line 46-60)
|
||||
- calculateAverage function (Line 117-124)
|
||||
- Change indicators calculation (Line 126-156)
|
||||
- Data refactoring (Line 87-162)
|
||||
|
||||
---
|
||||
|
||||
### 3. resources/views/admin-ajax/crew-performance.blade.php
|
||||
**Lines:** 44 (was 17)
|
||||
**Changes:** Complete rewrite
|
||||
|
||||
**Major sections:**
|
||||
- Monthly aggregation query (Line 5-19)
|
||||
- Data restructuring for DataGrid (Line 22-41)
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Testing Checklist
|
||||
|
||||
### Welder Performance
|
||||
- [x] Year filter visible and working
|
||||
- [x] Total WDI column showing correct sums
|
||||
- [x] AVG dividing by 12
|
||||
- [x] W columns showing green/red/yellow with arrows
|
||||
- [x] % columns showing growth percentages with +/- signs
|
||||
- [x] Summary footer displaying all totals
|
||||
- [x] Excel export working
|
||||
- [x] Excel cells color-coded correctly
|
||||
|
||||
### Zone Performance
|
||||
- [x] Area column visible
|
||||
- [x] Data loading correctly
|
||||
- [x] Excel export working
|
||||
|
||||
### Crew Performance
|
||||
- [x] Simple view showing months × teams
|
||||
- [x] NPS1 and Count for each month
|
||||
- [x] Toggle working between Simple/Pivot
|
||||
- [x] Pivot view with field chooser
|
||||
- [x] Summary footers working
|
||||
- [x] Excel export working for both views
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Performance Impact
|
||||
|
||||
**Queries:**
|
||||
- Welder Performance: 1 main query + 1 zone query + 1 crew query (optimized)
|
||||
- Zone Performance: Single query with aggregations
|
||||
- Crew Performance: Single query with monthly grouping
|
||||
|
||||
**Page Load:**
|
||||
- No significant performance impact
|
||||
- All queries use proper indexes
|
||||
- AJAX calls are cached by year parameter
|
||||
|
||||
---
|
||||
|
||||
## 💡 Future Enhancements (Optional)
|
||||
|
||||
### 1. Chart View for Crew Performance
|
||||
**Suggested:** Add third view option with DevExtreme charts
|
||||
- Stacked bar chart for monthly trends
|
||||
- Line chart for team comparison
|
||||
- Heatmap for visual performance matrix
|
||||
|
||||
**Estimated effort:** 15 minutes
|
||||
|
||||
---
|
||||
|
||||
### 2. Advanced Filtering
|
||||
**Suggested:** Add filters at top of dashboards
|
||||
- Subcontractor filter
|
||||
- Location filter
|
||||
- Date range picker
|
||||
|
||||
**Estimated effort:** 30 minutes
|
||||
|
||||
---
|
||||
|
||||
### 3. Real-time Updates
|
||||
**Suggested:** Auto-refresh every 5 minutes
|
||||
**Implementation:** JavaScript setInterval + AJAX reload
|
||||
|
||||
**Estimated effort:** 10 minutes
|
||||
|
||||
---
|
||||
|
||||
## 📚 Developer Notes
|
||||
|
||||
### Key Learnings
|
||||
|
||||
1. **DevExtreme Excel Export:**
|
||||
- Requires ExcelJS library
|
||||
- Must use `onExporting` callback in v23.1+
|
||||
- `fileName` set in export config doesn't work, must use callback
|
||||
|
||||
2. **String vs Number:**
|
||||
- Backend queries return numeric values as strings
|
||||
- Always use `parseFloat()` before numeric operations
|
||||
- Use `|| 0` for null safety
|
||||
|
||||
3. **Change Indicators:**
|
||||
- Must calculate in sequential order (1-12)
|
||||
- Cannot rely on foreach field iteration
|
||||
- Separate indicators for different metrics
|
||||
|
||||
4. **DataGrid Initialization:**
|
||||
- Always provide initial `dataSource: []`
|
||||
- Call `.refresh()` after updating dataSource
|
||||
- Use `keyBy()` for efficient lookups in PHP
|
||||
|
||||
---
|
||||
|
||||
### Common Pitfalls Avoided
|
||||
|
||||
1. ❌ Using `eval()` for calculations (security risk)
|
||||
2. ❌ Assuming numeric values are numbers (they're often strings)
|
||||
3. ❌ Forgetting to call `.refresh()` on dataSource change
|
||||
4. ❌ Using field order instead of month sequence for calculations
|
||||
|
||||
---
|
||||
|
||||
## 🔗 Related Files
|
||||
|
||||
### Models
|
||||
- `App\Models\WeldLog` (weld_logs table)
|
||||
|
||||
### Helper Functions
|
||||
- `welder_locations()` - Get welder location mapping
|
||||
- `numberToMonth($k)` - Convert month number to name
|
||||
- `db($table)` - Database query helper
|
||||
- `json_encode_tr($data)` - Turkish-safe JSON encoding
|
||||
|
||||
### Dependencies
|
||||
- DevExtreme 23.1.5
|
||||
- ExcelJS 4.1.1
|
||||
- FileSaver.js 2.0.2
|
||||
- jQuery
|
||||
|
||||
---
|
||||
|
||||
## ✅ Quality Assurance
|
||||
|
||||
### Code Standards
|
||||
- ✅ All text in English (as per project rules)
|
||||
- ✅ No Turkish characters in code
|
||||
- ✅ Consistent indentation
|
||||
- ✅ Proper commenting
|
||||
- ✅ No debug statements in production code
|
||||
|
||||
### Browser Compatibility
|
||||
- ✅ Chrome/Edge (tested)
|
||||
- ✅ Firefox (should work)
|
||||
- ✅ Safari (should work)
|
||||
|
||||
### Performance
|
||||
- ✅ Optimized SQL queries
|
||||
- ✅ Minimal client-side processing
|
||||
- ✅ Efficient data structures
|
||||
- ✅ No memory leaks
|
||||
|
||||
---
|
||||
|
||||
## 📝 Commit Information
|
||||
|
||||
**Branch:** `Construction-Dashboards-Charts-271025`
|
||||
**Commit Hash:** 28110f5f0
|
||||
**Commit Message:**
|
||||
```
|
||||
feat: Enhanced Welder/Zone/Crew Performance dashboards with year filter,
|
||||
total WDI, summary footer, and Excel export
|
||||
```
|
||||
|
||||
**Files Changed:** 3
|
||||
**Insertions:** +564
|
||||
**Deletions:** -198
|
||||
|
||||
---
|
||||
|
||||
## 🎓 Knowledge Transfer
|
||||
|
||||
### To modify Year Total WDI calculation:
|
||||
**File:** `resources/views/admin-ajax/welder-performance.blade.php` (Line 119-123)
|
||||
|
||||
### To change color scheme:
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php`
|
||||
- Frontend colors: Line 89-90 (W column), Line 102-103 (% column)
|
||||
- Excel colors: Line 149-180 (customizeCell)
|
||||
|
||||
### To add new summary items:
|
||||
**File:** `resources/views/admin/type/welder-performance.blade.php` (Line 178-210)
|
||||
|
||||
### To modify crew performance structure:
|
||||
**File:** `resources/views/admin-ajax/crew-performance.blade.php` (Complete file)
|
||||
|
||||
---
|
||||
|
||||
## 🏁 Conclusion
|
||||
|
||||
This implementation successfully delivered all requested features for the Welder, Zone, and Crew Performance dashboards. The code is clean, optimized, and ready for production use.
|
||||
|
||||
**Key Achievements:**
|
||||
- ✅ All task requirements met
|
||||
- ✅ Additional features added (toggle views, Excel color coding)
|
||||
- ✅ Multiple bugs fixed
|
||||
- ✅ Code optimized and cleaned
|
||||
- ✅ Proper documentation provided
|
||||
|
||||
**Status:** COMPLETE ✅
|
||||
|
||||
---
|
||||
|
||||
**End of Report**
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
# Construction Dashboards - User Guide
|
||||
|
||||
**Version:** 1.0 | **Date:** October 30, 2025
|
||||
|
||||
---
|
||||
|
||||
## 1. Welder Performance Dashboard
|
||||
|
||||
### Year Filter
|
||||
**Location:** Top right corner
|
||||
**How to use:** Select year (2022-2025) → page refreshes automatically
|
||||
|
||||
### Columns Explained
|
||||
|
||||
| Column | Meaning | Color Guide |
|
||||
|--------|---------|-------------|
|
||||
| **Welder** | Welder ID | - |
|
||||
| **Subcontractor** | Company name | - |
|
||||
| **Location** | Work location | - |
|
||||
| **Avg** | Monthly average WDI | Divides by 12 months |
|
||||
| **Total WDI** | Year total | Sum of all months |
|
||||
| **W** | Monthly WDI | 🟢↑ Up / 🔴↓ Down / 🟡= Same |
|
||||
| **RR%** | Repair Rate % | 🔴 High (bad) / 🟢 Low (good) |
|
||||
|
||||
**RR% = (Repair WDI / Normal WDI) × 100**
|
||||
Lower is better (0% = perfect, no repairs needed)
|
||||
|
||||
### Bottom Summary
|
||||
- Total welders count
|
||||
- Sum and Average for each month
|
||||
- RR% Average per month
|
||||
|
||||
### Excel Export
|
||||
**Button:** Top right of table
|
||||
**Filename:** `Welder_Performance_2024.xlsx`
|
||||
**Features:** Color-coded cells (W = light green, RR% = green/red)
|
||||
|
||||
---
|
||||
|
||||
## 2. Zone Performance Dashboard
|
||||
|
||||
### Columns
|
||||
|
||||
| Column | What it shows |
|
||||
|--------|---------------|
|
||||
| **Zone** | Project zone name |
|
||||
| **Area** | Design area code |
|
||||
| **Total** | Total WDI |
|
||||
| **Welded** | Completed (Shop/Field) |
|
||||
| **Backlog** | Pending (Shop/Field) |
|
||||
| **Process %** | Completion percentage |
|
||||
|
||||
### Bottom Summary
|
||||
- Total Zones: Count
|
||||
- Total WDI: Sum
|
||||
|
||||
### Excel Export
|
||||
**Filename:** `Zone_Performance_2024.xlsx`
|
||||
|
||||
---
|
||||
|
||||
## 3. Crew Performance Dashboard
|
||||
|
||||
### Two Views
|
||||
|
||||
#### Pivot View (Default - Opens First)
|
||||
**Best for:** Quick overview and analysis
|
||||
|
||||
**Layout:**
|
||||
- **Rows:** Subcontractor → Team Leader
|
||||
- **Columns:** Months (Jan-Dec)
|
||||
- **Values:** NPS1 sum + Joint count
|
||||
|
||||
**How to use:**
|
||||
1. Click ▶ to expand subcontractor
|
||||
2. Use Field Chooser (right) to rearrange
|
||||
3. Bottom row shows Grand Total
|
||||
|
||||
#### Simple View
|
||||
**Best for:** Detailed month-by-month data
|
||||
**Switch:** Click "Simple View" button
|
||||
|
||||
**Layout:**
|
||||
- Each month: 2 columns (NPS1 + Count)
|
||||
- Total columns at end (yearly sum)
|
||||
- Gray background on Total columns
|
||||
- Grand Total footer
|
||||
|
||||
### Excel Export
|
||||
- **Pivot View:** `Crew_Performance_Pivot_2024.xlsx` (headers gray)
|
||||
- **Simple View:** `Crew_Performance_Simple_2024.xlsx`
|
||||
|
||||
---
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. **Select Year** → Top right dropdown
|
||||
2. **Review Data** → Check tables for performance metrics
|
||||
3. **Export** → Click Export button for Excel files
|
||||
|
||||
---
|
||||
|
||||
## Color Guide
|
||||
|
||||
**In Tables:**
|
||||
- 🟢 Green = Good / Improvement
|
||||
- 🔴 Red = Issues / Decline
|
||||
- 🟡 Yellow = No change
|
||||
- ⬜ Gray = Totals
|
||||
|
||||
**In Excel:**
|
||||
- Same colors preserved
|
||||
- Easy to analyze offline
|
||||
|
||||
---
|
||||
|
||||
## Tips
|
||||
|
||||
### Welder Performance
|
||||
- ✅ Lower RR% is better
|
||||
- ✅ Green arrows = improving
|
||||
- ✅ Check Total WDI for yearly productivity
|
||||
|
||||
### Zone Performance
|
||||
- ✅ Filter by Area (search box)
|
||||
- ✅ High Process % = near completion
|
||||
- ✅ Monitor Backlog
|
||||
|
||||
### Crew Performance
|
||||
- ✅ Pivot View for overview
|
||||
- ✅ Simple View for detailed analysis
|
||||
- ✅ Export for reports
|
||||
|
||||
---
|
||||
|
||||
## FAQ
|
||||
|
||||
**Q: Why is AVG different than expected?**
|
||||
A: Divides by 12 months (includes months with no activity)
|
||||
|
||||
**Q: What is RR%?**
|
||||
A: Repair Rate - lower is better (0% = no repairs)
|
||||
|
||||
**Q: Can I customize Pivot View?**
|
||||
A: Yes - use Field Chooser to drag/drop fields
|
||||
|
||||
**Q: How to share data?**
|
||||
A: Use Excel Export - colors preserved
|
||||
|
||||
---
|
||||
|
||||
**Need Help?** Contact system administrator
|
||||
|
||||
@@ -1,346 +0,0 @@
|
||||
# DataGrid Summary System Documentation
|
||||
|
||||
## English
|
||||
|
||||
### Overview
|
||||
This system provides dynamic COUNT/SUM/AVG summary calculations for DevExtreme DataGrid with optimized performance for large datasets.
|
||||
|
||||
### Key Features
|
||||
- **Server-side summary calculation** for better performance
|
||||
- **Dynamic whitelist system** for controlling which columns get summaries
|
||||
- **Automatic header-matching colors** for summary footers
|
||||
- **Sticky Total cell** for horizontal scrolling
|
||||
- **Optimized for large tables** (tested with 63K+ rows)
|
||||
|
||||
---
|
||||
|
||||
### How It Works
|
||||
|
||||
#### 1. Enable Summaries for a Module
|
||||
|
||||
By default, all modules get **30+ columns** for SUM/AVG calculations.
|
||||
|
||||
**For large tables** (like Weldlog), you can limit summaries to specific columns:
|
||||
|
||||
```php
|
||||
// In resources/views/admin/type/weldlog.blade.php
|
||||
$limitedSummaryColumns = ['nps_1', 'nps_2'];
|
||||
```
|
||||
|
||||
This creates only **3 summaries** total:
|
||||
- ID: COUNT
|
||||
- nps_1: SUM + AVG
|
||||
- nps_2: SUM + AVG
|
||||
|
||||
---
|
||||
|
||||
#### 2. Summary Types
|
||||
|
||||
**Total Summary (Bottom of table):**
|
||||
- Always shows: `Total: {count}` for ID column
|
||||
- Shows: `SUM: {value}` and `AVG: {value}` for whitelisted columns
|
||||
|
||||
**Group Summary (When grouping by column):**
|
||||
- Shows: `Count: {count}` for first column
|
||||
- Shows: `SUM: {value}` and `AVG: {value}` for whitelisted columns
|
||||
|
||||
---
|
||||
|
||||
#### 3. Default Whitelisted Columns (30 columns)
|
||||
|
||||
If you don't define `$limitedSummaryColumns`, these columns automatically get SUM/AVG:
|
||||
|
||||
```
|
||||
quantity, dia_inch_1, dn_1, odmm_1, schedule_1,
|
||||
diainch_2, dn_2, odmm_2, schedule_2, weight,
|
||||
pipe_dia, unit_weight, nps_1, nps_2, diamm,
|
||||
requested_quantity, received_quantity,
|
||||
min_dia, max_dia, min_dia2, max_dia2, max_thick, max_thick2,
|
||||
qualitication_outside_diameter_min, qualitication_outside_diameter_max,
|
||||
min_outside_diameter, max_outside_diameter,
|
||||
diameter, dia_min, dia_max
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### 4. Performance Settings
|
||||
|
||||
**Server-side Operations:**
|
||||
```javascript
|
||||
remoteOperations: {
|
||||
filtering: true,
|
||||
paging: true,
|
||||
sorting: true,
|
||||
groupPaging: false, // Client-side for better UX
|
||||
grouping: false, // Client-side for better UX
|
||||
summary: true // Server-side for performance
|
||||
}
|
||||
```
|
||||
|
||||
**Why server-side summary?**
|
||||
- ✅ Faster for large datasets (63K rows: 5.41s → 0.17s)
|
||||
- ✅ Reduces client memory usage
|
||||
- ✅ Backend handles calculations efficiently
|
||||
|
||||
---
|
||||
|
||||
#### 5. Styling
|
||||
|
||||
**Summary Footer Colors:**
|
||||
- Automatically match header column colors
|
||||
- Defined in `$blockGroup` color scheme
|
||||
- Rounded borders for better visibility
|
||||
|
||||
**Sticky Total Cell:**
|
||||
- "Total: X" cell stays visible when scrolling horizontally
|
||||
- Fixed to left side with z-index priority
|
||||
|
||||
---
|
||||
|
||||
### How to Add Summaries to Your Module
|
||||
|
||||
**Step 1:** Define which columns should have summaries (optional)
|
||||
|
||||
```php
|
||||
// For large tables only - limit to specific columns
|
||||
$limitedSummaryColumns = ['column1', 'column2'];
|
||||
```
|
||||
|
||||
**Step 2:** Done!
|
||||
|
||||
The system automatically:
|
||||
- ✅ Adds COUNT for ID
|
||||
- ✅ Adds SUM/AVG for your specified columns (or default 30 if not specified)
|
||||
- ✅ Styles summary footers with header colors
|
||||
- ✅ Makes Total cell sticky
|
||||
|
||||
---
|
||||
|
||||
### Disabling Summaries
|
||||
|
||||
If you don't want summaries at all:
|
||||
|
||||
```php
|
||||
$disableAllSummary = true; // Disables everything
|
||||
```
|
||||
|
||||
Or disable specific types:
|
||||
|
||||
```php
|
||||
$disableTotalSummary = true; // Disables total footer
|
||||
$disableGroupSummary = true; // Disables group summary
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Performance Benchmarks
|
||||
|
||||
**Weldlog Module (63,000 rows):**
|
||||
- Before optimization: ~5.41s load time
|
||||
- After optimization: ~0.17s load time
|
||||
- **96% faster!**
|
||||
|
||||
**Key optimizations:**
|
||||
1. Server-side summary calculation
|
||||
2. Limited summary columns (30 → 2 for Weldlog)
|
||||
3. Efficient whitelist checking
|
||||
|
||||
---
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
**Problem:** Summaries not showing
|
||||
- Check if `$disableAllSummary` is set
|
||||
- Verify column names in `$limitedSummaryColumns` match actual column names
|
||||
- Check browser console for JavaScript errors
|
||||
|
||||
**Problem:** Slow performance
|
||||
- Add `$limitedSummaryColumns` to limit summary calculations
|
||||
- Ensure `remoteOperations.summary` is `true`
|
||||
|
||||
**Problem:** Colors not matching headers
|
||||
- Verify `$blockGroup` is defined for your module
|
||||
- Check if columns are included in block groups
|
||||
|
||||
---
|
||||
|
||||
## Türkçe
|
||||
|
||||
### Genel Bakış
|
||||
Bu sistem, DevExtreme DataGrid için dinamik COUNT/SUM/AVG özet hesaplamaları sağlar ve büyük veri setleri için optimize edilmiş performans sunar.
|
||||
|
||||
### Temel Özellikler
|
||||
- **Sunucu tarafı özet hesaplama** - daha iyi performans için
|
||||
- **Dinamik whitelist sistemi** - hangi kolonların özet alacağını kontrol eder
|
||||
- **Otomatik header-eşleşen renkler** - özet footer'ları için
|
||||
- **Yapışkan Total hücresi** - yatay kaydırmada
|
||||
- **Büyük tablolar için optimize** - 63K+ satırla test edildi
|
||||
|
||||
---
|
||||
|
||||
### Nasıl Çalışır?
|
||||
|
||||
#### 1. Modül İçin Özetleri Aktifleştir
|
||||
|
||||
Varsayılan olarak, tüm modüller **30+ kolon** için SUM/AVG hesaplamaları alır.
|
||||
|
||||
**Büyük tablolar için** (Weldlog gibi), özetleri belirli kolonlarla sınırlandırabilirsiniz:
|
||||
|
||||
```php
|
||||
// resources/views/admin/type/weldlog.blade.php içinde
|
||||
$limitedSummaryColumns = ['nps_1', 'nps_2'];
|
||||
```
|
||||
|
||||
Bu sadece **3 özet** oluşturur:
|
||||
- ID: COUNT (sayım)
|
||||
- nps_1: SUM + AVG (toplam + ortalama)
|
||||
- nps_2: SUM + AVG (toplam + ortalama)
|
||||
|
||||
---
|
||||
|
||||
#### 2. Özet Tipleri
|
||||
|
||||
**Total Summary (Tablonun altında):**
|
||||
- Her zaman gösterir: `Total: {sayı}` ID kolonu için
|
||||
- Gösterir: `SUM: {değer}` ve `AVG: {değer}` whitelist kolonları için
|
||||
|
||||
**Group Summary (Kolonlara göre gruplandırıldığında):**
|
||||
- Gösterir: `Count: {sayı}` ilk kolon için
|
||||
- Gösterir: `SUM: {değer}` ve `AVG: {değer}` whitelist kolonları için
|
||||
|
||||
---
|
||||
|
||||
#### 3. Varsayılan Whitelist Kolonları (30 kolon)
|
||||
|
||||
Eğer `$limitedSummaryColumns` tanımlamazsanız, bu kolonlar otomatik SUM/AVG alır:
|
||||
|
||||
```
|
||||
quantity, dia_inch_1, dn_1, odmm_1, schedule_1,
|
||||
diainch_2, dn_2, odmm_2, schedule_2, weight,
|
||||
pipe_dia, unit_weight, nps_1, nps_2, diamm,
|
||||
requested_quantity, received_quantity,
|
||||
min_dia, max_dia, min_dia2, max_dia2, max_thick, max_thick2,
|
||||
qualitication_outside_diameter_min, qualitication_outside_diameter_max,
|
||||
min_outside_diameter, max_outside_diameter,
|
||||
diameter, dia_min, dia_max
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### 4. Performans Ayarları
|
||||
|
||||
**Sunucu Tarafı İşlemler:**
|
||||
```javascript
|
||||
remoteOperations: {
|
||||
filtering: true,
|
||||
paging: true,
|
||||
sorting: true,
|
||||
groupPaging: false, // Daha iyi UX için client-side
|
||||
grouping: false, // Daha iyi UX için client-side
|
||||
summary: true // Performans için server-side
|
||||
}
|
||||
```
|
||||
|
||||
**Neden sunucu tarafı özet?**
|
||||
- ✅ Büyük veri setleri için daha hızlı (63K satır: 5.41s → 0.17s)
|
||||
- ✅ Client bellek kullanımını azaltır
|
||||
- ✅ Backend hesaplamaları verimli yönetir
|
||||
|
||||
---
|
||||
|
||||
#### 5. Görsel Düzenlemeler
|
||||
|
||||
**Özet Footer Renkleri:**
|
||||
- Otomatik olarak header kolon renkleriyle eşleşir
|
||||
- `$blockGroup` renk şemasında tanımlıdır
|
||||
- Daha iyi görünürlük için yuvarlak kenarlıklar
|
||||
|
||||
**Yapışkan Total Hücresi:**
|
||||
- "Total: X" hücresi yatay kaydırmada görünür kalır
|
||||
- Sol tarafa sabitlenir, z-index önceliği vardır
|
||||
|
||||
---
|
||||
|
||||
### Modülünüze Özet Nasıl Eklenir?
|
||||
|
||||
**Adım 1:** Hangi kolonların özet alacağını tanımlayın (isteğe bağlı)
|
||||
|
||||
```php
|
||||
// Sadece büyük tablolar için - belirli kolonlarla sınırla
|
||||
$limitedSummaryColumns = ['kolon1', 'kolon2'];
|
||||
```
|
||||
|
||||
**Adım 2:** Bitti!
|
||||
|
||||
Sistem otomatik olarak:
|
||||
- ✅ ID için COUNT ekler
|
||||
- ✅ Belirttiğiniz kolonlar için SUM/AVG ekler (veya belirtmediyseniz varsayılan 30)
|
||||
- ✅ Özet footer'larını header renkleriyle stillendirir
|
||||
- ✅ Total hücresini yapışkan yapar
|
||||
|
||||
---
|
||||
|
||||
### Özetleri Devre Dışı Bırakma
|
||||
|
||||
Hiç özet istemiyorsanız:
|
||||
|
||||
```php
|
||||
$disableAllSummary = true; // Her şeyi devre dışı bırakır
|
||||
```
|
||||
|
||||
Veya belirli tipleri devre dışı bırakın:
|
||||
|
||||
```php
|
||||
$disableTotalSummary = true; // Total footer'ı devre dışı bırakır
|
||||
$disableGroupSummary = true; // Group summary'yi devre dışı bırakır
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Performans Karşılaştırması
|
||||
|
||||
**Weldlog Modülü (63,000 satır):**
|
||||
- Optimizasyon öncesi: ~5.41s yüklenme
|
||||
- Optimizasyon sonrası: ~0.17s yüklenme
|
||||
- **%96 daha hızlı!**
|
||||
|
||||
**Ana optimizasyonlar:**
|
||||
1. Sunucu tarafı özet hesaplama
|
||||
2. Sınırlı özet kolonları (30 → 2 Weldlog için)
|
||||
3. Verimli whitelist kontrolü
|
||||
|
||||
---
|
||||
|
||||
### Sorun Giderme
|
||||
|
||||
**Sorun:** Özetler görünmüyor
|
||||
- `$disableAllSummary` ayarlandı mı kontrol edin
|
||||
- `$limitedSummaryColumns` içindeki kolon isimlerinin gerçek kolon isimleriyle eşleştiğini doğrulayın
|
||||
- Tarayıcı konsolunda JavaScript hataları kontrol edin
|
||||
|
||||
**Sorun:** Yavaş performans
|
||||
- `$limitedSummaryColumns` ekleyerek özet hesaplamalarını sınırlandırın
|
||||
- `remoteOperations.summary`'nin `true` olduğundan emin olun
|
||||
|
||||
**Sorun:** Renkler header'larla eşleşmiyor
|
||||
- Modülünüz için `$blockGroup` tanımlandığını doğrulayın
|
||||
- Kolonların blok gruplarına dahil olduğunu kontrol edin
|
||||
|
||||
---
|
||||
|
||||
## Code Reference
|
||||
|
||||
### Files Modified
|
||||
- `resources/views/components/table/datagrid.blade.php` - Main DataGrid component
|
||||
- `resources/views/admin/type/weldlog.blade.php` - Example usage
|
||||
|
||||
### Key Variables
|
||||
- `$limitedSummaryColumns` - Array of column names for limited summary
|
||||
- `$disableAllSummary` - Boolean to disable all summaries
|
||||
- `$disableTotalSummary` - Boolean to disable total footer
|
||||
- `$disableGroupSummary` - Boolean to disable group summary
|
||||
|
||||
### Performance Limits
|
||||
- `$maxTotalSummaries = 400` - Maximum total summary items
|
||||
- `$maxSummaries = 400` - Maximum group summary items
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
# Excel Şablonunda Çoklu Section Template Row Sistemi
|
||||
|
||||
## 📋 Genel Bakış
|
||||
|
||||
Bu sistem, Excel şablonlarında farklı section'lar için özelleştirilmiş template row'ların yönetimini sağlar. Her section için ayrı template row'lar tanımlanabilir ve veriler bu template'lere göre dinamik olarak yerleştirilir.
|
||||
|
||||
## 🔑 Temel Özellikler
|
||||
|
||||
- Çoklu section desteği (Section 1, 2, 3)
|
||||
- Dinamik satır ekleme ve yönetimi
|
||||
- Akıllı offset hesaplama sistemi
|
||||
- Formül ve merge işlemlerinin otomatik güncellenmesi
|
||||
- Detaylı loglama sistemi
|
||||
|
||||
## 💡 Çalışma Prensibi
|
||||
|
||||
### 1. Section Bazlı Veri Yönetimi
|
||||
```php
|
||||
$sectionedDetails = [];
|
||||
foreach($resultDetail as $detail) {
|
||||
$section = intval($detail->section);
|
||||
if (!isset($sectionedDetails[$section])) {
|
||||
$sectionedDetails[$section] = [];
|
||||
}
|
||||
$sectionedDetails[$section][] = $detail;
|
||||
}
|
||||
```
|
||||
|
||||
### 2. Template Row Offset Hesaplama
|
||||
```php
|
||||
$totalAddedRows = 0; // Önceki section'larda eklenen toplam satır
|
||||
$startRow = $originalStartRow + $totalAddedRows; // Offset uygulanmış satır
|
||||
```
|
||||
|
||||
## 🛠️ Teknik Detaylar
|
||||
|
||||
### Template Row İşlemleri
|
||||
|
||||
1. **Template Row Tanımlama**
|
||||
- Her section için ayrı template row numarası belirlenir
|
||||
- Template row'lar Excel şablonunda önceden tanımlanır
|
||||
|
||||
2. **Veri Yerleştirme**
|
||||
- Her section için template row kopyalanır
|
||||
- Placeholder'lar gerçek verilerle değiştirilir
|
||||
- Boş section'lar için placeholder'lar temizlenir
|
||||
|
||||
3. **Formül ve Merge Yönetimi**
|
||||
- Formüller offset'e göre güncellenir
|
||||
- Merge işlemleri yeni satır numaralarına göre ayarlanır
|
||||
|
||||
### Örnek Section Yapısı
|
||||
|
||||
```json
|
||||
{
|
||||
"section1": {
|
||||
"template_row": 14,
|
||||
"data": [...],
|
||||
},
|
||||
"section2": {
|
||||
"template_row": 17,
|
||||
"data": [...],
|
||||
},
|
||||
"section3": {
|
||||
"template_row": 22,
|
||||
"data": [...],
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 📊 Veri Akışı
|
||||
|
||||
1. SQL sorgusundan section bazlı veri alınır
|
||||
2. Veriler section'lara göre gruplanır
|
||||
3. Her section için:
|
||||
- Template row kopyalanır
|
||||
- Veriler yerleştirilir
|
||||
- Offset hesaplanır
|
||||
- Formüller güncellenir
|
||||
- Merge işlemleri yapılır
|
||||
|
||||
## 🔍 Loglama Sistemi
|
||||
|
||||
```php
|
||||
function logProcessInfo($message, $data = [], $type = 'info') {
|
||||
$logData = [
|
||||
'timestamp' => date('Y-m-d H:i:s'),
|
||||
'type' => $type,
|
||||
'message' => $message,
|
||||
'memory_usage' => round(memory_get_usage() / 1024 / 1024, 2) . ' MB',
|
||||
'data' => $data
|
||||
];
|
||||
// Log kayıt işlemleri...
|
||||
}
|
||||
```
|
||||
|
||||
## ⚠️ Dikkat Edilmesi Gerekenler
|
||||
|
||||
1. **Template Row Pozisyonları**
|
||||
- Template row'lar arası mesafe yeterli olmalı
|
||||
- Section sıralaması doğru yapılmalı
|
||||
|
||||
2. **Veri Doğrulama**
|
||||
- Section numaraları kontrol edilmeli
|
||||
- Veri tipleri doğrulanmalı
|
||||
|
||||
3. **Performans**
|
||||
- Büyük veri setlerinde bellek yönetimi
|
||||
- Formül hesaplama optimizasyonu
|
||||
|
||||
## 🔄 İşlem Adımları
|
||||
|
||||
1. **Başlangıç**
|
||||
- Excel şablonu yüklenir
|
||||
- SQL sorguları çalıştırılır
|
||||
- Section'lar belirlenir
|
||||
|
||||
2. **Veri İşleme**
|
||||
- Her section için veriler gruplanır
|
||||
- Template row'lar kopyalanır
|
||||
- Offset hesaplanır
|
||||
|
||||
3. **Sonlandırma**
|
||||
- Template row'lar temizlenir
|
||||
- Excel dosyası kaydedilir
|
||||
- PDF dönüşümü yapılır
|
||||
|
||||
## 📈 Performans İyileştirmeleri
|
||||
|
||||
- Bellek yönetimi optimizasyonu
|
||||
- Formül hesaplama stratejisi
|
||||
- Merge işlemlerinin optimize edilmesi
|
||||
- Gereksiz döngülerin azaltılması
|
||||
|
||||
## 🎯 Kullanım Senaryoları
|
||||
|
||||
1. **Çoklu Bölümlü Raporlar**
|
||||
- Farklı veri grupları
|
||||
- Özelleştirilmiş formatlar
|
||||
- Dinamik içerik
|
||||
|
||||
2. **Karmaşık Form Şablonları**
|
||||
- Çoklu veri girişi
|
||||
- Özel formatlama
|
||||
- Otomatik hesaplamalar
|
||||
|
||||
## 🔧 Hata Yönetimi
|
||||
|
||||
- Detaylı loglama sistemi
|
||||
- Section bazlı hata yakalama
|
||||
- Veri doğrulama kontrolleri
|
||||
- Bellek yönetimi izleme
|
||||
@@ -1,115 +0,0 @@
|
||||
# NAKS Synchronization & Trigger System Documentation
|
||||
|
||||
This document explains the technical architecture and workflow of the NAKS multi-project synchronization system. This system ensures that when a NAKS certificate changes its "Source Project" (ownership), all other project sites are notified and updated automatically.
|
||||
|
||||
---
|
||||
|
||||
# 🇹🇷 Türkçe Dokümantasyon
|
||||
|
||||
## 1. Genel Bakış
|
||||
NAKS Senkronizasyon Sistemi, birden fazla proje sahasında (Web Uygulaması) ortak bir veri havuzunun korunmasını sağlar. Özellikle `naks_certificates` (Technology) modülünde, bir sertifikanın "Source Project" (Kaynak Proje) alanı değiştiğinde, diğer tüm projelerin bu değişikliği anında öğrenmesi ve verilerini güncellemesi gerekir.
|
||||
|
||||
Bu sistem, **Event-Driven (Olay Güdümlü)** bir yapı kullanır:
|
||||
1. Kullanıcı bir kaydı düzenler.
|
||||
2. Sistem değişikliği algılar.
|
||||
3. Diğer projelere "Senkronizasyon Yap" emri gönderilir.
|
||||
4. Diğer projeler, güncel veriyi çeker.
|
||||
|
||||
## 2. Mimari Bileşenler
|
||||
|
||||
Sistem 4 ana bileşenden oluşur:
|
||||
|
||||
### A. Observer (Gözlemci)
|
||||
**Dosya:** `app/Observers/NaksCertificateObserver.php`
|
||||
* Veritabanındaki `updated` olayını dinler.
|
||||
* Eğer `source_project` sütunu değişmişse (örneğin Viksa'dan boş/bu proje'ye geçmişse) tetiklenir.
|
||||
* `TriggerNaksSyncJob`'ı kuyruğa (Queue) ekler.
|
||||
|
||||
### B. Trigger Job (Tetikleyici İş)
|
||||
**Dosya:** `app/Jobs/TriggerNaksSyncJob.php`
|
||||
* Arka planda (Queue) çalışır.
|
||||
* Sistemdeki diğer tüm proje URL'lerini (`api/project-app-urls`) listeler.
|
||||
* Kendisi hariç diğer tüm projelere `POST /api/naks/trigger-sync` isteği atar.
|
||||
|
||||
### C. Endpoint Controller (Karşılayıcı Uç Nokta)
|
||||
**Dosya:** `app/Http/Controllers/Api/NaksSyncController.php`
|
||||
* Diğer projelerden gelen tetikleme isteklerini karşılar.
|
||||
* İstek geldiğinde güvenlik kontrolü yapar.
|
||||
* Gelen isteğe göre `NaksSyncService->sync()` metodunu çalıştıracak bir işlemi kuyruğa alır.
|
||||
|
||||
### D. Sync Service (Senkronizasyon Servisi)
|
||||
**Dosya:** `app/Services/NaksSyncService.php`
|
||||
* Asıl işi yapan servistir.
|
||||
* Karşı projeye bağlanır, token alır ve verileri (`naks_certificates`) indirip yerel veritabanını günceller.
|
||||
* Conflict (Çakışma) yönetimi yapar (timestamp kontrolü).
|
||||
|
||||
## 3. İş Akışı (Workflow)
|
||||
|
||||
1. **Adım 1:** Kullanıcı A Projesinde bir NAKS sertifikasını düzenler ve `Source Project` alanını değiştirir (örneğin temizler).
|
||||
2. **Adım 2:** `NaksCertificateObserver` bu değişikliği yakalar.
|
||||
3. **Adım 3:** Observer, `TriggerNaksSyncJob` başlatır.
|
||||
4. **Adım 4:** Job, Proje B ve Proje C'ye API isteği gönderir: `POST .../api/naks/trigger-sync`.
|
||||
5. **Adım 5:** Proje B isteği alır, doğrular ve kendi kuyruğuna "Senkronizasyon Başlat" emri verir.
|
||||
6. **Adım 6:** Proje B, arka planda Proje A'ya bağlanır ve güncellenmiş kaydı kendi veritabanına yazar.
|
||||
|
||||
## 4. Kurulum ve Gereksinimler
|
||||
|
||||
* **Queue Worker:** Sistemin çalışması için Laravel Queue Worker (`php artisan queue:work`) sunucuda çalışıyor olmalıdır.
|
||||
* **Observer Kaydı:** `AppServiceProvider` içerisinde observer tanımlı olmalıdır.
|
||||
* **Yetkilendirme:** `.env` dosyasında `SYNC_ADMIN_EMAIL` ve `SYNC_ADMIN_PASSWORD` tanımlı olmalıdır.
|
||||
|
||||
---
|
||||
|
||||
# 🇬🇧 English Documentation
|
||||
|
||||
## 1. Overview
|
||||
The NAKS Synchronization System maintains a shared data pool across multiple project sites (Web Applications). Specifically for the `naks_certificates` (Technology) module, when the "Source Project" field of a certificate changes, all other projects must be notified immediately to update their local data.
|
||||
|
||||
The system uses an **Event-Driven** architecture:
|
||||
1. User updates a record.
|
||||
2. System detects the change.
|
||||
3. A "Trigger Sync" command is sent to other projects.
|
||||
4. Other projects pull the latest data.
|
||||
|
||||
## 2. Architecture Components
|
||||
|
||||
The system consists of 4 main components:
|
||||
|
||||
### A. Observer
|
||||
**File:** `app/Observers/NaksCertificateObserver.php`
|
||||
* Listens for the database `updated` event.
|
||||
* Triggers if the `source_project` column has changed (e.g., changed from 'Viksa' to empty/this project).
|
||||
* Dispatches `TriggerNaksSyncJob` to the queue.
|
||||
|
||||
### B. Trigger Job
|
||||
**File:** `app/Jobs/TriggerNaksSyncJob.php`
|
||||
* Runs in the background (Queue).
|
||||
* Lists all other project URLs via (`api/project-app-urls`).
|
||||
* Sends a `POST /api/naks/trigger-sync` request to all projects except the current one.
|
||||
|
||||
### C. Endpoint Controller
|
||||
**File:** `app/Http/Controllers/Api/NaksSyncController.php`
|
||||
* Receives trigger requests from other projects.
|
||||
* Validates the incoming request.
|
||||
* Queues a task to run `NaksSyncService->sync()` based on the trigger.
|
||||
|
||||
### D. Sync Service
|
||||
**File:** `app/Services/NaksSyncService.php`
|
||||
* The core service that performs logic.
|
||||
* Connects to the remote project, authenticates, downloads data (`naks_certificates`), and updates the local database.
|
||||
* Handles conflict resolution (via timestamp checks).
|
||||
|
||||
## 3. Workflow
|
||||
|
||||
1. **Step 1:** User modifies a NAKS certificate in Project A and changes the `Source Project` field.
|
||||
2. **Step 2:** `NaksCertificateObserver` captures this event.
|
||||
3. **Step 3:** The Observer dispatches `TriggerNaksSyncJob`.
|
||||
4. **Step 4:** The Job sends an API request to Project B and Project C: `POST .../api/naks/trigger-sync`.
|
||||
5. **Step 5:** Project B receives the request, validates it, and queues a "Start Sync" command locally.
|
||||
6. **Step 6:** Project B connects to Project A in the background and updates its local record with the new data.
|
||||
|
||||
## 4. Setup & Requirements
|
||||
|
||||
* **Queue Worker:** A Laravel Queue Worker (`php artisan queue:work`) must be running on the server for asynchronous processing.
|
||||
* **Observer Registration:** The observer must be registered in `AppServiceProvider`.
|
||||
* **Authentication:** `SYNC_ADMIN_EMAIL` and `SYNC_ADMIN_PASSWORD` must be configured in the `.env` file.
|
||||
@@ -1,474 +0,0 @@
|
||||
# PDF Editor - Database Schema & Data Flow
|
||||
|
||||
## Database Table: `annotations`
|
||||
|
||||
### Location
|
||||
- **Migration File**: `database/migrations/2025_09_29_104240_create_annotations_table.php`
|
||||
- **Updated Migration**: `database/migrations/2025_10_16_131634_update_annotations_shape_type_enum.php`
|
||||
|
||||
### Table Structure
|
||||
|
||||
```sql
|
||||
CREATE TABLE annotations (
|
||||
id BIGINT PRIMARY KEY AUTO_INCREMENT,
|
||||
pdf_file VARCHAR(255),
|
||||
page_number INT,
|
||||
shape_type ENUM('rect', 'circle', 'triangle', 'spool', 'weld', 'shop_weld', 'leader_line', 'text'),
|
||||
x_coordinate DECIMAL(10,2),
|
||||
y_coordinate DECIMAL(10,2),
|
||||
width DECIMAL(10,2),
|
||||
height DECIMAL(10,2),
|
||||
shape_id VARCHAR(100),
|
||||
spool_no VARCHAR(100),
|
||||
joint_type TEXT,
|
||||
classification VARCHAR(50),
|
||||
created_by BIGINT,
|
||||
created_at TIMESTAMP,
|
||||
updated_at TIMESTAMP
|
||||
);
|
||||
```
|
||||
|
||||
### Field Descriptions
|
||||
|
||||
| Field | Type | Description | Used For |
|
||||
|-------|------|-------------|----------|
|
||||
| `id` | BIGINT | Primary key | Unique identifier |
|
||||
| `pdf_file` | VARCHAR(255) | PDF file path | Linking annotations to specific PDFs |
|
||||
| `page_number` | INT | Page number | Multi-page PDF support |
|
||||
| `shape_type` | ENUM | Type of annotation | rect, circle, triangle, spool, weld, shop_weld, leader_line, text |
|
||||
| `x_coordinate` | DECIMAL(10,2) | X position | Canvas coordinate (for shapes: top-left, for lines: start point) |
|
||||
| `y_coordinate` | DECIMAL(10,2) | Y position | Canvas coordinate |
|
||||
| `width` | DECIMAL(10,2) | Width/Delta X | Shape width or line X distance |
|
||||
| `height` | DECIMAL(10,2) | Height/Delta Y | Shape height or line Y distance |
|
||||
| `shape_id` | VARCHAR(100) | Unique shape ID | Cross-referencing (leader lines to shapes, QR codes) |
|
||||
| `spool_no` | VARCHAR(100) | Spool number | Business data for welding |
|
||||
| `joint_type` | TEXT | Joint type or text content | Business data for welding OR free text content |
|
||||
| `classification` | VARCHAR(50) | Annotation category | 'shape_text', 'free_text', etc. |
|
||||
| `created_by` | BIGINT | User ID | Audit trail |
|
||||
| `created_at` | TIMESTAMP | Creation time | Audit trail |
|
||||
| `updated_at` | TIMESTAMP | Update time | Audit trail |
|
||||
|
||||
### Special Field Usage
|
||||
|
||||
#### Leader Lines
|
||||
- `shape_type`: 'leader_line'
|
||||
- `x_coordinate`, `y_coordinate`: Start point (click point)
|
||||
- `width`: Delta X (x2 - x1)
|
||||
- `height`: Delta Y (y2 - y1)
|
||||
- Additional metadata stored in backend:
|
||||
- `connectedShapeId`: The shape this line connects to
|
||||
- `originalStartPoint`: Original click coordinates for reconnection
|
||||
|
||||
#### Text Annotations
|
||||
- `shape_type`: 'text'
|
||||
- `joint_type`: Contains the actual text content
|
||||
- `classification`:
|
||||
- 'shape_text': Text inside shapes (red, bold, 28px)
|
||||
- 'free_text': Standalone notes (black, normal, 16px)
|
||||
|
||||
#### Shapes (rect, circle, triangle, etc.)
|
||||
- Standard coordinate and dimension fields
|
||||
- `spool_no`: **Business identifier - populated from Spool Number dropdown**
|
||||
- Rectangle shapes: Display spool_no as text inside shape
|
||||
- Source: MTO (Material Take-Off) data or manually generated
|
||||
- Dropdown ID: `#spool-select`
|
||||
- `joint_type`: **Joint/Weld classification - populated from Weld Number dropdown**
|
||||
- Triangle/Circle shapes: Display joint_type (weld number) as text inside shape
|
||||
- Source: MTO welders data or manually entered
|
||||
- Dropdown ID: `#weld-select`
|
||||
- `shape_id`: Used for QR code generation and leader line connection
|
||||
|
||||
**Shape Type → Data Mapping:**
|
||||
- **Rectangle** → Uses `spool_no` for text content
|
||||
- **Triangle** → Uses `joint_type` (weld number) for text content
|
||||
- **Circle** → Uses `joint_type` (weld number) for text content
|
||||
|
||||
---
|
||||
|
||||
## Data Population System
|
||||
|
||||
### Spool Number (`spool_no` field)
|
||||
|
||||
#### What is it?
|
||||
Spool number is a unique identifier for a spool in piping/welding systems. In the PDF Editor, this value is used to label rectangle shapes.
|
||||
|
||||
#### How it's populated:
|
||||
1. **From MTO Data** (Material Take-Off):
|
||||
```javascript
|
||||
// Function: populateMtoForms()
|
||||
// Populates dropdown from mtoData.spools array
|
||||
spoolSelect.innerHTML = '<option value="">Select Spool</option>';
|
||||
mtoData.spools.forEach(spool => {
|
||||
option.value = spool.spool_number; // e.g., "SP001"
|
||||
option.textContent = spool.spool_number;
|
||||
});
|
||||
```
|
||||
|
||||
2. **Auto-Generate**:
|
||||
- Button: "Generate" next to Spool Number dropdown
|
||||
- API Call: `GET /api/mto/spools/generate-number`
|
||||
- Returns: New unique spool number (e.g., "SP123")
|
||||
|
||||
3. **Manual Selection**:
|
||||
- User selects from dropdown: `<select id="spool-select">`
|
||||
- Value is stored when shape is created
|
||||
|
||||
#### When it's used:
|
||||
- **Rectangle shapes**: Display spool_no inside the shape as red text
|
||||
- **Shape creation**: Value is read from dropdown and assigned to `shape.spoolNo`
|
||||
- **Database save**: Stored in `annotations.spool_no` column
|
||||
|
||||
#### Code Flow:
|
||||
```javascript
|
||||
// 1. User selects spool from dropdown
|
||||
<select id="spool-select">
|
||||
<option value="SP001">SP001</option>
|
||||
<option value="SP002">SP002</option>
|
||||
</select>
|
||||
|
||||
// 2. User draws rectangle with leader line
|
||||
const spoolSelect = document.getElementById('spool-select');
|
||||
const spoolNo = spoolSelect.value; // "SP001"
|
||||
|
||||
// 3. Shape is created with spool number
|
||||
shape.set('spoolNo', spoolNo);
|
||||
|
||||
// 4. Text is added inside rectangle
|
||||
textContent = (spoolNo && spoolNo.trim() !== '') ? spoolNo : 'N/A';
|
||||
// Result: "SP001" displayed in red inside rectangle
|
||||
|
||||
// 5. Save to database
|
||||
annotation = {
|
||||
spool_no: obj.spoolNo, // "SP001"
|
||||
shape_type: 'rect',
|
||||
...
|
||||
};
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Weld/Joint Number (`joint_type` field)
|
||||
|
||||
#### What is it?
|
||||
Weld/Joint number is a unique identifier for a weld joint in piping systems. In the PDF Editor, this value is used to label triangle and circle shapes.
|
||||
|
||||
#### How it's populated:
|
||||
1. **From MTO Welders Data**:
|
||||
```javascript
|
||||
// Function: populateMtoForms()
|
||||
// Populates dropdown from mtoData.welders array
|
||||
weldSelect.innerHTML = '<option value="">Select Weld</option>';
|
||||
mtoData.welders.forEach(welder => {
|
||||
option.value = welder.welder_code; // e.g., "W001"
|
||||
option.textContent = welder.welder_code;
|
||||
});
|
||||
```
|
||||
|
||||
2. **Auto-Generate**:
|
||||
- Button: "Generate" next to Weld Number dropdown
|
||||
- API Call: `GET /api/mto/joints/generate-number?spool_no={spoolNo}`
|
||||
- Returns: New joint number based on spool (e.g., "J-SP001-001")
|
||||
|
||||
3. **Manual Selection**:
|
||||
- User selects from dropdown: `<select id="weld-select">`
|
||||
- Value is stored when shape is created
|
||||
|
||||
#### When it's used:
|
||||
- **Triangle shapes**: Display joint_type inside the shape as red text
|
||||
- **Circle shapes**: Display joint_type inside the shape as red text
|
||||
- **Shape creation**: Value is read from dropdown and assigned to `shape.weldNo`
|
||||
- **Database save**: Stored in `annotations.joint_type` column
|
||||
|
||||
#### Code Flow:
|
||||
```javascript
|
||||
// 1. User selects weld from dropdown
|
||||
<select id="weld-select">
|
||||
<option value="W001">W001</option>
|
||||
<option value="W002">W002</option>
|
||||
</select>
|
||||
|
||||
// 2. User draws triangle with leader line
|
||||
const weldSelect = document.getElementById('weld-select');
|
||||
const weldNo = weldSelect.value; // "W001"
|
||||
|
||||
// 3. Shape is created with weld number
|
||||
shape.set('weldNo', weldNo);
|
||||
|
||||
// 4. Text is added inside triangle
|
||||
textContent = (weldNo && weldNo.trim() !== '') ? weldNo : 'N/A';
|
||||
// Result: "W001" displayed in red inside triangle
|
||||
|
||||
// 5. Save to database
|
||||
annotation = {
|
||||
joint_type: obj.weldNo, // "W001"
|
||||
shape_type: 'triangle',
|
||||
...
|
||||
};
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Current Status Issue
|
||||
|
||||
**Problem**: `spool_no` field is currently empty in database
|
||||
|
||||
**Possible Reasons**:
|
||||
1. **MTO Data Not Loaded**: `mtoData.spools` array is empty or not fetched
|
||||
2. **Dropdown Not Selected**: User is creating shapes without selecting spool/weld number
|
||||
3. **Sample Data**: System falls back to sample data (SP001, SP002, SP003) if MTO data is missing
|
||||
4. **API Integration**: MTO API endpoints might not be returning data
|
||||
|
||||
**How to Fix**:
|
||||
1. Check MTO data loading in browser console
|
||||
2. Ensure dropdown has options before creating shapes
|
||||
3. Select spool/weld number from dropdown before drawing
|
||||
4. Verify API endpoints are working:
|
||||
- `/api/mto/spools/generate-number`
|
||||
- `/api/mto/joints/generate-number`
|
||||
|
||||
**Testing**:
|
||||
```javascript
|
||||
// Open browser console on PDF Editor page
|
||||
console.log('MTO Data:', mtoData);
|
||||
console.log('Spools:', mtoData.spools);
|
||||
console.log('Welders:', mtoData.welders);
|
||||
|
||||
// Check dropdown values
|
||||
const spoolSelect = document.getElementById('spool-select');
|
||||
console.log('Spool options:', Array.from(spoolSelect.options).map(o => o.value));
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## API Endpoints
|
||||
|
||||
### 1. Save/Sync Annotations
|
||||
**Endpoint**: `POST /api/pdf-editor/annotations/sync`
|
||||
|
||||
**Controller**: `app/Http/Controllers/Api/AnnotationController.php` → `syncAnnotations()`
|
||||
|
||||
**Request Body**:
|
||||
```json
|
||||
{
|
||||
"pdf_file": "path/to/file.pdf",
|
||||
"page_number": 1,
|
||||
"annotations": [
|
||||
{
|
||||
"shape_id": "shape-1729612345678",
|
||||
"spool_no": "SP-001",
|
||||
"joint_type": "Butt Weld",
|
||||
"classification": "",
|
||||
"page_number": 1,
|
||||
"x_coordinate": 100,
|
||||
"y_coordinate": 200,
|
||||
"width": 140,
|
||||
"height": 70,
|
||||
"shape_type": "rect",
|
||||
"pdf_file_path": "path/to/file.pdf",
|
||||
"created_by": 1
|
||||
},
|
||||
{
|
||||
"shape_id": "leader-1729612345680",
|
||||
"shape_type": "leader_line",
|
||||
"x_coordinate": 150,
|
||||
"y_coordinate": 180,
|
||||
"width": 0,
|
||||
"height": 50,
|
||||
"connectedShapeId": "shape-1729612345678",
|
||||
"originalStartPoint": {"x": 150, "y": 180}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Response**:
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "Annotations synced successfully",
|
||||
"data": {
|
||||
"deleted": 2,
|
||||
"created": 5
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Logic**:
|
||||
1. Deletes all existing annotations for the specific PDF page
|
||||
2. Inserts all new annotations from the request
|
||||
3. Transaction-based for data integrity
|
||||
|
||||
---
|
||||
|
||||
### 2. Load Annotations
|
||||
**Endpoint**: `GET /api/pdf-editor/annotations?pdf_file={path}&page_number={num}`
|
||||
|
||||
**Controller**: `app/Http/Controllers/Api/AnnotationController.php` → `index()`
|
||||
|
||||
**Response**:
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": [
|
||||
{
|
||||
"id": 123,
|
||||
"pdf_file": "path/to/file.pdf",
|
||||
"page_number": 1,
|
||||
"shape_type": "triangle",
|
||||
"x_coordinate": 300,
|
||||
"y_coordinate": 400,
|
||||
"width": 140,
|
||||
"height": 140,
|
||||
"shape_id": "shape-1729612345690",
|
||||
"spool_no": "SP-002",
|
||||
"joint_type": "Fillet",
|
||||
"classification": "",
|
||||
"created_by": 1,
|
||||
"created_at": "2025-10-22 10:30:00",
|
||||
"updated_at": "2025-10-22 10:30:00"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 3. Generate QR Code
|
||||
**Endpoint**: `GET /api/pdf-editor/qr-code/{shapeId}`
|
||||
|
||||
**Controller**: `app/Http/Controllers/Api/AnnotationController.php` → `generateQRCode()`
|
||||
|
||||
**Response**: PNG image data (base64 or binary)
|
||||
|
||||
**Used For**: Generating QR codes for shape annotations
|
||||
|
||||
---
|
||||
|
||||
## Data Flow Diagram
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ PDF EDITOR FRONTEND │
|
||||
│ (pdf-editor.blade.php) │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
│ User draws shapes,
|
||||
│ adds text, creates
|
||||
│ leader lines
|
||||
▼
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ FABRIC.JS CANVAS │
|
||||
│ - Shapes (rect, circle, triangle) │
|
||||
│ - Leader Lines (connecting click point to shape edge) │
|
||||
│ - Text Objects (free text notes + shape text) │
|
||||
│ - QR Codes (linked to shapes) │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
│ Save button clicked
|
||||
▼
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ saveCurrentPageAnnotations() │
|
||||
│ - Iterates through all canvas objects │
|
||||
│ - Skips QR codes (not saved) │
|
||||
│ - Converts shapes, lines, text to annotation format │
|
||||
│ - Prepares JSON payload │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
│ POST /api/pdf-editor/annotations/sync
|
||||
▼
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ API: AnnotationController@syncAnnotations │
|
||||
│ 1. Validates request data │
|
||||
│ 2. Starts database transaction │
|
||||
│ 3. Deletes old annotations for this page │
|
||||
│ 4. Inserts new annotations │
|
||||
│ 5. Commits transaction │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ DATABASE TABLE │
|
||||
│ `annotations` │
|
||||
│ - All annotations stored with coordinates, types, metadata │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
│ Page reload or PDF selection
|
||||
│ GET /api/pdf-editor/annotations
|
||||
▼
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ API: AnnotationController@index │
|
||||
│ - Fetches annotations for specified PDF + page │
|
||||
│ - Returns JSON array │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ loadExistingAnnotations() │
|
||||
│ - Receives annotation data from API │
|
||||
│ - Calls loadAnnotationToCanvas() for each │
|
||||
│ - Recreates shapes, lines, text on canvas │
|
||||
│ - Calls reconnectLeaderLines() to re-establish connections │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ FABRIC.JS CANVAS │
|
||||
│ - All annotations restored │
|
||||
│ - Leader lines connected to shapes │
|
||||
│ - QR codes regenerated via API │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Key Implementation Details
|
||||
|
||||
### Triangle Leader Line Connection
|
||||
- **Challenge**: Triangles have different geometry than rectangles/circles
|
||||
- **Solution**: Custom `calculateEdgePoint()` function in `setupConnectedMovement()`
|
||||
- Calculates triangle vertices and edges
|
||||
- Determines closest edge/vertex based on original click position
|
||||
- Connects leader line to appropriate edge point
|
||||
- Handles rotation, scaling, and movement events
|
||||
|
||||
### Unique Shape IDs
|
||||
- Generated using `Date.now()` to ensure uniqueness across page reloads
|
||||
- Format: `shape-{timestamp}`, `leader-{timestamp}`, `text-{timestamp}`
|
||||
- Prevents database conflicts when saving new annotations
|
||||
|
||||
### Text Handling
|
||||
- **Shape Text**: Red, bold, 28px, positioned inside shapes, non-selectable
|
||||
- **Free Text**: Black, normal, 16px, standalone notes, selectable
|
||||
- Both saved to same table with different `classification` values
|
||||
|
||||
### Leader Line Storage
|
||||
- Start point stored as `x_coordinate`, `y_coordinate`
|
||||
- End point calculated using `width` and `height` deltas
|
||||
- Metadata (`connectedShapeId`, `originalStartPoint`) preserved for reconnection
|
||||
|
||||
---
|
||||
|
||||
## Validation Rules
|
||||
|
||||
```php
|
||||
// app/Http/Controllers/Api/AnnotationController.php
|
||||
|
||||
'annotations' => 'required|array',
|
||||
'annotations.*.shape_type' => 'required|in:rect,circle,triangle,spool,weld,shop_weld,leader_line,text',
|
||||
'annotations.*.x_coordinate' => 'required|numeric',
|
||||
'annotations.*.y_coordinate' => 'required|numeric',
|
||||
'annotations.*.width' => 'nullable|numeric',
|
||||
'annotations.*.height' => 'nullable|numeric',
|
||||
'annotations.*.shape_id' => 'required|string',
|
||||
'annotations.*.page_number' => 'required|integer',
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Future Enhancements
|
||||
- Add annotation history/versioning
|
||||
- Implement collaborative editing with user tracking
|
||||
- Add annotation comments/notes
|
||||
- Support for more shape types
|
||||
- Advanced leader line routing (avoid overlaps)
|
||||
|
||||
@@ -1,764 +0,0 @@
|
||||
# PDF Editor Step 3 - Joint Widget & Weldmap Entegrasyonu Roadmap
|
||||
|
||||
## 📋 Görev Özeti
|
||||
|
||||
**Amaç:** PDF çizimlerinde interaktif joint veri girişi sağlamak ve PDF Editor, Base Weldmap ve Weldlog veritabanları arasında iki yönlü entegrasyon kurmak.
|
||||
|
||||
**Temel Gereksinimler:**
|
||||
1. Veri girişi için interaktif joint widget (popup)
|
||||
2. Kayıt edilene kadar geçici veri depolama
|
||||
3. Base Weldmap ve Weldlog ile SQL entegrasyonu
|
||||
4. İki yönlü veri senkronizasyonu
|
||||
5. Document Revision entegrasyonu (Spool Iso / As-Build)
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Fonksiyonel Gereksinimler Özeti
|
||||
|
||||
### Senaryo 1: Engineering Iso + Adding Joints
|
||||
- Kullanıcı PDF üzerine üçgen (Field) veya yuvarlak (Shop) çizer
|
||||
- Veri girişi için widget otomatik açılır
|
||||
- Veriler kayıt edilene kadar hafızada tutulur
|
||||
- Kayıt sırasında: SQL ile Base Weldmap'e ekleme
|
||||
- Çizimi Document Revision "Spool Iso" kısmına kaydet
|
||||
|
||||
### Senaryo 2: Spool Iso/Asbuild Iso + Adding Joints & Welder
|
||||
- Kullanıcı mevcut joint üzerine gelir
|
||||
- Widget önceden girilmiş verilerle açılır (Welder1-2 boş)
|
||||
- Welder1-2 dropdown'larında uygun kaynakçıları listele
|
||||
- PDF görüntüsünü güncelle: joint no (üstte), welder ID (altta), ayırıcı çizgi
|
||||
- Kayıt sırasında: SQL ile Weldlog'u güncelle
|
||||
- Çizimi Document Revision "As-Build" kısmına kaydet
|
||||
|
||||
### Senaryo 3: Veri Var ama Çizim Eksik
|
||||
- Base Weldmap/Welder verisi var ama çizim eksik mi kontrol et
|
||||
- Sol paneli aktifleştir: Spool No, Joint No, Welder ID bölümleri
|
||||
- Kullanıcı Spool No seçer → Joint listesi
|
||||
- Kullanıcı Joint + F/S şekli seçer → Çizim görünür
|
||||
- Kullanıcı Joint + Welder + F/S şekli seçer → Welder ile çizim görünür
|
||||
- Document Revision'a kaydet (Spool Iso veya As-Build)
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ Geliştirme Roadmap'i
|
||||
|
||||
### Faz 1: Temel Yapı & Veri Yapısı (Hafta 1)
|
||||
|
||||
#### 1.1 Geçici Veri Depolama Sistemi
|
||||
**Hedef:** Kaydedilmemiş joint verileri için hafıza içi veri depolama sistemi oluştur
|
||||
|
||||
**Görevler:**
|
||||
- [ ] Geçici depolama için `JointDataManager` JavaScript sınıfı oluştur
|
||||
- [ ] Veri yapısını uygula: `Map<shapeId, jointData>`
|
||||
- [ ] Depolamadan önce veri doğrulama ekle
|
||||
- [ ] Tarayıcı sessionStorage'da veri kalıcılığı (yedek)
|
||||
- [ ] Sayfa kapanışında veri temizleme oluştur
|
||||
|
||||
**En İyi Uygulamalar:**
|
||||
- O(1) arama performansı için Map kullan
|
||||
- Çakışma çözümü için veri versiyonlama uygula
|
||||
- Depolamadan önce veri doğrulama katmanı ekle
|
||||
- Sayfa yenilemede hayatta kalması için sessionStorage kullan
|
||||
|
||||
**Oluşturulacak/Değiştirilecek Dosyalar:**
|
||||
- `resources/views/admin/type/pdf-editor.blade.php` (JointDataManager sınıfı ekle)
|
||||
- Oluştur: `public/js/pdf-editor/joint-data-manager.js` (opsiyonel ayrım)
|
||||
|
||||
#### 1.2 Widget Modal Geliştirmesi
|
||||
**Hedef:** Mevcut joint widget modal'ını tüm gerekli alanlarla geliştir
|
||||
|
||||
**Görevler:**
|
||||
- [ ] `joint-widget-modal.blade.php` dosyasını gözden geçir ve geliştir
|
||||
- [ ] Edit type'a göre koşullu alan gösterimi ekle
|
||||
- [ ] IC Log member seçimi uygula (Member1, Member2)
|
||||
- [ ] IC Log'dan Material, Dia, NPS, Thickness için otomatik doldurma mantığı ekle
|
||||
- [ ] Yeterliliğe göre welder dropdown filtreleme uygula
|
||||
- [ ] Form doğrulama ekle
|
||||
|
||||
**En İyi Uygulamalar:**
|
||||
- Dropdown'lar için Select2 kullan (projede mevcut)
|
||||
- Member seçimi için debounced API çağrıları uygula
|
||||
- Kademeli dropdown'lar uygula (member → material detayları)
|
||||
- Asenkron işlemler için yükleme durumları ekle
|
||||
- Bootstrap 5 form doğrulama kullan
|
||||
|
||||
**Değiştirilecek Dosyalar:**
|
||||
- `resources/views/components/modals/joint-widget-modal.blade.php`
|
||||
- `resources/views/admin/type/pdf-editor.blade.php` (widget entegrasyonu)
|
||||
|
||||
**Önemli Not:** Widget açılışı için **double-click** kullanılacak. Mevcut double-click silme özelliği kaldırılmalı veya farklı bir tuş kombinasyonu ile değiştirilmelidir.
|
||||
|
||||
---
|
||||
|
||||
### Phase 2: Shape Interaction & Widget Integration (Week 1-2)
|
||||
|
||||
#### 2.1 Shape Click/Hover Event Handling
|
||||
**Goal:** Open widget when user interacts with joint shapes
|
||||
|
||||
**Tasks:**
|
||||
- [ ] Add click event listener to triangle/circle shapes
|
||||
- [ ] Add hover event listener for existing joints (Scenario 2)
|
||||
- [ ] Position widget near clicked shape
|
||||
- [ ] Load existing data if joint already has data
|
||||
- [ ] Handle shape creation event (Scenario 1)
|
||||
|
||||
**Best Practices:**
|
||||
- Use Fabric.js event delegation for performance
|
||||
- Implement debouncing for hover events
|
||||
- Calculate optimal widget position (avoid screen edges)
|
||||
- Use requestAnimationFrame for smooth animations
|
||||
- Add visual feedback (highlight shape on hover)
|
||||
|
||||
**Implementation:**
|
||||
```javascript
|
||||
// Shape click handler
|
||||
fabricCanvas.on('mouse:down', (e) => {
|
||||
if (e.target && (e.target.type === 'triangle' || e.target.type === 'circle')) {
|
||||
if (currentEditType === 'adding_joints' || currentEditType === 'adding_joints_welder') {
|
||||
openJointWidget(e.target, e.e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Hover handler for existing joints
|
||||
fabricCanvas.on('mouse:over', (e) => {
|
||||
if (e.target && e.target.shapeId && hasExistingData(e.target.shapeId)) {
|
||||
showHoverTooltip(e.target);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
#### 2.2 Widget Data Binding
|
||||
**Goal:** Connect widget form with shape data
|
||||
|
||||
**Tasks:**
|
||||
- [ ] Load shape data into widget form
|
||||
- [ ] Save widget data to temporary storage
|
||||
- [ ] Update shape label display (joint no, welder ID)
|
||||
- [ ] Handle form field changes (real-time updates)
|
||||
- [ ] Implement cancel/close behavior
|
||||
|
||||
**Best Practices:**
|
||||
- Use two-way data binding pattern
|
||||
- Implement reactive updates (update shape when form changes)
|
||||
- Add unsaved changes warning
|
||||
- Use event-driven architecture
|
||||
|
||||
**Files to Modify:**
|
||||
- `resources/views/admin/type/pdf-editor.blade.php`
|
||||
- `resources/views/components/modals/joint-widget-modal.blade.php`
|
||||
|
||||
---
|
||||
|
||||
### Phase 3: API Development & Database Integration (Week 2)
|
||||
|
||||
#### 3.1 API Endpoints for Joint Data
|
||||
**Goal:** Create RESTful API endpoints for joint operations
|
||||
|
||||
**Tasks:**
|
||||
- [ ] Create `saveJointData` endpoint (already exists, enhance)
|
||||
- [ ] Create `getJointData` endpoint
|
||||
- [ ] Create `checkExistingWeldmapData` endpoint (already exists)
|
||||
- [ ] Create `getQualifiedWelders` endpoint
|
||||
- [ ] Create `getICLogMembers` endpoint (already exists)
|
||||
- [ ] Create `getICLogMemberDetails` endpoint (already exists)
|
||||
|
||||
**Best Practices:**
|
||||
- Use Laravel Resource classes for consistent responses
|
||||
- Implement proper validation rules
|
||||
- Add error handling and logging
|
||||
- Use database transactions for data integrity
|
||||
- Implement rate limiting for API calls
|
||||
|
||||
**Files to Create/Modify:**
|
||||
- `app/Http/Controllers/Api/AnnotationController.php` (enhance existing)
|
||||
- `app/Http/Controllers/Api/PdfEditorLookupController.php` (enhance existing)
|
||||
- `routes/web.php` (add routes if needed)
|
||||
|
||||
#### 3.2 Base Weldmap Integration
|
||||
**Goal:** Insert/update joint data in Base Weldmap
|
||||
|
||||
**Tasks:**
|
||||
- [ ] Map widget form data to weld_logs table structure
|
||||
- [ ] Implement insert logic for new joints
|
||||
- [ ] Implement update logic for existing joints
|
||||
- [ ] Handle field mapping (widget → database)
|
||||
- [ ] Add validation for required fields
|
||||
- [ ] Implement batch insert for multiple joints
|
||||
|
||||
**Database Mapping:**
|
||||
```
|
||||
Widget Field → weld_logs Column
|
||||
- joint_no → no_of_the_joint_as_per_as_built_survey
|
||||
- type_of_joint → type_of_joint (F/S)
|
||||
- welding_date → welding_date
|
||||
- spool_no1 → spool_number_1
|
||||
- spool_no2 → spool_number_2
|
||||
- pose_no1 → pose_number_1
|
||||
- pose_no2 → pose_number_2
|
||||
- member1 → member_1
|
||||
- member2 → member_2
|
||||
- material → material_1, material_2
|
||||
- dia1 → dia_1
|
||||
- dia2 → dia_2
|
||||
- nps1 → nps_1
|
||||
- nps2 → nps_2
|
||||
- thickness1 → thickness_1
|
||||
- thickness2 → thickness_2
|
||||
- welder_id1 → welder_1
|
||||
- welder_id2 → welder_2
|
||||
```
|
||||
|
||||
**Best Practices:**
|
||||
- Use Eloquent models for database operations
|
||||
- Implement database transactions
|
||||
- Add rollback on error
|
||||
- Use bulk insert for performance
|
||||
- Validate data before database operations
|
||||
|
||||
**Files to Modify:**
|
||||
- `app/Http/Controllers/Api/AnnotationController.php`
|
||||
- `app/Models/WeldLog.php` (if needed)
|
||||
|
||||
#### 3.3 Weldlog Integration
|
||||
**Goal:** Update welder assignments in Weldlog
|
||||
|
||||
**Tasks:**
|
||||
- [ ] Implement welder assignment update logic
|
||||
- [ ] Handle real_welder_1 and real_welder_2 fields
|
||||
- [ ] Update joint display on PDF after assignment
|
||||
- [ ] Validate welder qualifications before assignment
|
||||
|
||||
**Best Practices:**
|
||||
- Use updateOrCreate for idempotent operations
|
||||
- Implement soft validation (warnings, not errors)
|
||||
- Add audit trail for welder changes
|
||||
- Use database transactions
|
||||
|
||||
**Files to Modify:**
|
||||
- `app/Http/Controllers/Api/AnnotationController.php`
|
||||
- `app/Models/WeldLog.php`
|
||||
|
||||
---
|
||||
|
||||
### Phase 4: Two-Way Data Synchronization (Week 2-3)
|
||||
|
||||
#### 4.1 Data Existence Check
|
||||
**Goal:** Check if Base Weldmap/Welder data exists but drawing is missing
|
||||
|
||||
**Tasks:**
|
||||
- [ ] Create API endpoint to check data existence
|
||||
- [ ] Implement left panel activation logic
|
||||
- [ ] Create Spool No dropdown population
|
||||
- [ ] Create Joint No dropdown (filtered by Spool)
|
||||
- [ ] Create Welder ID dropdown (filtered by Joint)
|
||||
|
||||
**API Endpoint:**
|
||||
```php
|
||||
GET /api/pdf-editor/check-existing-weldmap
|
||||
Query: drawing_number
|
||||
Response: {
|
||||
has_data: true/false,
|
||||
spools: [...],
|
||||
joints: [...],
|
||||
welders: [...]
|
||||
}
|
||||
```
|
||||
|
||||
**Best Practices:**
|
||||
- Cache API responses for performance
|
||||
- Implement pagination for large datasets
|
||||
- Use eager loading for relationships
|
||||
- Add loading states in UI
|
||||
|
||||
**Files to Create/Modify:**
|
||||
- `app/Http/Controllers/Api/PdfEditorLookupController.php`
|
||||
- `resources/views/admin/type/pdf-editor.blade.php` (left panel)
|
||||
|
||||
#### 4.2 Drawing Generation from Data
|
||||
**Goal:** Generate PDF drawing shapes from existing database data
|
||||
|
||||
**Tasks:**
|
||||
- [ ] Implement shape creation from joint data
|
||||
- [ ] Position shapes based on joint relationships
|
||||
- [ ] Add welder labels if welder data exists
|
||||
- [ ] Handle F/S shape selection
|
||||
- [ ] Update annotation storage
|
||||
|
||||
**Best Practices:**
|
||||
- Use Fabric.js for shape creation
|
||||
- Implement smart positioning algorithm
|
||||
- Add collision detection
|
||||
- Use canvas grouping for related shapes
|
||||
|
||||
**Files to Modify:**
|
||||
- `resources/views/admin/type/pdf-editor.blade.php`
|
||||
|
||||
---
|
||||
|
||||
### Phase 5: Document Revision Integration (Week 3)
|
||||
|
||||
#### 5.1 Save to Spool Iso
|
||||
**Goal:** Save annotated PDF to Document Revision "Spool Iso"
|
||||
|
||||
**Tasks:**
|
||||
- [ ] Implement PDF export with annotations
|
||||
- [ ] Save to Document Revision pdf_spool_iso column
|
||||
- [ ] Update revision metadata
|
||||
- [ ] Handle versioning
|
||||
|
||||
**Best Practices:**
|
||||
- Use existing PDF export functionality
|
||||
- Implement async save operation
|
||||
- Add progress indicator
|
||||
- Handle save errors gracefully
|
||||
|
||||
**Files to Modify:**
|
||||
- `app/Http/Controllers/Api/AnnotationController.php`
|
||||
- `app/Http/Controllers/Api/PdfEditorLookupController.php` (updateDocumentStage)
|
||||
|
||||
#### 5.2 Save to As-Build
|
||||
**Goal:** Save annotated PDF to Document Revision "As-Build"
|
||||
|
||||
**Tasks:**
|
||||
- [ ] Similar to Spool Iso but for pdf_as_build column
|
||||
- [ ] Include welder information in saved PDF
|
||||
- [ ] Update revision metadata
|
||||
|
||||
**Files to Modify:**
|
||||
- Same as 5.1
|
||||
|
||||
---
|
||||
|
||||
### Phase 6: Welder Qualification Filtering (Week 3)
|
||||
|
||||
#### 6.1 Welder Qualification System
|
||||
**Goal:** Filter welders based on qualifications and validity
|
||||
|
||||
**Tasks:**
|
||||
- [ ] Integrate with existing Welder Assignment system
|
||||
- [ ] Implement qualification filtering logic
|
||||
- [ ] Check welder expiry dates
|
||||
- [ ] Filter by material compatibility
|
||||
- [ ] Filter by welding method
|
||||
|
||||
**Best Practices:**
|
||||
- Reuse existing welder assignment logic
|
||||
- Cache qualification data
|
||||
- Implement client-side filtering for performance
|
||||
- Add server-side validation
|
||||
|
||||
**Files to Modify:**
|
||||
- `app/Http/Controllers/Api/PdfEditorLookupController.php`
|
||||
- `app/Http/Controllers/AutoCompleteType/welder-assignment/welder_1.php` (reference)
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Technical Architecture
|
||||
|
||||
### Frontend Architecture
|
||||
|
||||
```
|
||||
PDF Editor Canvas (Fabric.js)
|
||||
↓
|
||||
Shape Event Handlers
|
||||
↓
|
||||
Joint Data Manager (Temporary Storage)
|
||||
↓
|
||||
Widget Modal (Form)
|
||||
↓
|
||||
API Calls (AJAX)
|
||||
↓
|
||||
Backend Controllers
|
||||
↓
|
||||
Database (weld_logs, annotations, document_revisions)
|
||||
```
|
||||
|
||||
### Data Flow
|
||||
|
||||
**Scenario 1: New Joint Creation**
|
||||
```
|
||||
User draws shape → Widget opens → User fills form →
|
||||
Data stored in memory → User clicks Save →
|
||||
Batch insert to weld_logs → Save PDF to Document Revision
|
||||
```
|
||||
|
||||
**Scenario 2: Welder Assignment**
|
||||
```
|
||||
User hovers joint → Widget opens (pre-filled) →
|
||||
User selects welders → Update memory →
|
||||
User clicks Save → Update weld_logs →
|
||||
Update PDF display → Save PDF to Document Revision
|
||||
```
|
||||
|
||||
**Scenario 3: Drawing from Data**
|
||||
```
|
||||
Check data exists → Activate left panel →
|
||||
User selects Spool → Joints list →
|
||||
User selects Joint + Shape → Create shape on PDF →
|
||||
Save PDF to Document Revision
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📚 Best Practices & Recommendations
|
||||
|
||||
### 1. Temporary Data Storage
|
||||
|
||||
**Option A: In-Memory (Recommended)**
|
||||
- Use JavaScript Map/Object for fast access
|
||||
- Store in component state
|
||||
- Clear on page unload
|
||||
- **Pros:** Fast, no persistence needed
|
||||
- **Cons:** Lost on page refresh
|
||||
|
||||
**Option B: SessionStorage**
|
||||
- Use browser sessionStorage API
|
||||
- Survives page refresh
|
||||
- Auto-clears on tab close
|
||||
- **Pros:** Persistence
|
||||
- **Cons:** Limited size, string serialization
|
||||
|
||||
**Recommendation:** Use in-memory storage with sessionStorage backup
|
||||
|
||||
```javascript
|
||||
class JointDataManager {
|
||||
constructor() {
|
||||
this.data = new Map();
|
||||
this.loadFromSession();
|
||||
}
|
||||
|
||||
save(shapeId, jointData) {
|
||||
this.data.set(shapeId, jointData);
|
||||
this.saveToSession();
|
||||
}
|
||||
|
||||
saveToSession() {
|
||||
const data = Object.fromEntries(this.data);
|
||||
sessionStorage.setItem('jointData', JSON.stringify(data));
|
||||
}
|
||||
|
||||
loadFromSession() {
|
||||
const stored = sessionStorage.getItem('jointData');
|
||||
if (stored) {
|
||||
const data = JSON.parse(stored);
|
||||
this.data = new Map(Object.entries(data));
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 2. Widget Positioning
|
||||
|
||||
**Option A: Fixed Position (Current)**
|
||||
- Modal in center of screen
|
||||
- **Pros:** Simple, consistent
|
||||
- **Cons:** May cover important content
|
||||
|
||||
**Option B: Dynamic Positioning (Recommended)**
|
||||
- Position near clicked shape
|
||||
- Calculate based on shape coordinates
|
||||
- **Pros:** Better UX, doesn't cover content
|
||||
- **Cons:** More complex
|
||||
|
||||
**Recommendation:** Use dynamic positioning with fallback to center
|
||||
|
||||
```javascript
|
||||
function calculateWidgetPosition(shape, canvas) {
|
||||
const shapeBounds = shape.getBoundingRect();
|
||||
const canvasOffset = canvas.getElement().getBoundingClientRect();
|
||||
|
||||
const x = canvasOffset.left + shapeBounds.left + shapeBounds.width;
|
||||
const y = canvasOffset.top + shapeBounds.top;
|
||||
|
||||
// Check if fits on screen
|
||||
const windowWidth = window.innerWidth;
|
||||
const windowHeight = window.innerHeight;
|
||||
const widgetWidth = 600; // Modal width
|
||||
const widgetHeight = 500; // Estimated modal height
|
||||
|
||||
let finalX = x;
|
||||
let finalY = y;
|
||||
|
||||
if (x + widgetWidth > windowWidth) {
|
||||
finalX = x - widgetWidth - 20; // Position to left
|
||||
}
|
||||
|
||||
if (y + widgetHeight > windowHeight) {
|
||||
finalY = windowHeight - widgetHeight - 20;
|
||||
}
|
||||
|
||||
return { x: finalX, y: finalY };
|
||||
}
|
||||
```
|
||||
|
||||
### 3. API Design
|
||||
|
||||
**RESTful Endpoints:**
|
||||
```
|
||||
POST /api/pdf-editor/joint-data - Save joint data
|
||||
GET /api/pdf-editor/joint-data/{id} - Get joint data
|
||||
PUT /api/pdf-editor/joint-data/{id} - Update joint data
|
||||
DELETE /api/pdf-editor/joint-data/{id} - Delete joint data
|
||||
GET /api/pdf-editor/qualified-welders - Get qualified welders
|
||||
GET /api/pdf-editor/check-weldmap - Check existing weldmap data
|
||||
```
|
||||
|
||||
**Request/Response Format:**
|
||||
```json
|
||||
// POST /api/pdf-editor/joint-data
|
||||
{
|
||||
"drawing_number": "CW-800-AH01JL-FA00.001",
|
||||
"joints": [
|
||||
{
|
||||
"shape_id": "J-001",
|
||||
"joint_no": "53A",
|
||||
"type_of_joint": "F",
|
||||
"welding_date": "2025-01-15",
|
||||
"spool_no1": "SP01",
|
||||
"spool_no2": "SP02",
|
||||
// ... other fields
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
// Response
|
||||
{
|
||||
"success": true,
|
||||
"message": "Joint data saved successfully",
|
||||
"data": {
|
||||
"saved_count": 1,
|
||||
"joints": [...]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 4. Database Transactions
|
||||
|
||||
**Best Practice:** Use database transactions for data integrity
|
||||
|
||||
```php
|
||||
public function saveJointData(Request $request): JsonResponse
|
||||
{
|
||||
DB::beginTransaction();
|
||||
|
||||
try {
|
||||
foreach ($request->joints as $jointData) {
|
||||
WeldLog::updateOrCreate(
|
||||
[
|
||||
'iso_number' => $request->drawing_number,
|
||||
'no_of_the_joint_as_per_as_built_survey' => $jointData['joint_no'],
|
||||
],
|
||||
[
|
||||
// ... field mappings
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
return response()->json(['success' => true]);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::error('Failed to save joint data', ['error' => $e->getMessage()]);
|
||||
return response()->json(['success' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 5. Welder Qualification Filtering
|
||||
|
||||
**Integration with Existing System:**
|
||||
- Reuse `welder_1.php` autocomplete logic
|
||||
- Filter by material compatibility (MaterialGroupMap)
|
||||
- Filter by welding method
|
||||
- Check expiry dates
|
||||
- Filter by qualification status
|
||||
|
||||
**Implementation:**
|
||||
```php
|
||||
public function getQualifiedWelders(Request $request): JsonResponse
|
||||
{
|
||||
$request->validate([
|
||||
'material_1' => 'required|string',
|
||||
'material_2' => 'required|string',
|
||||
'welding_method' => 'required|string',
|
||||
'joint_type' => 'nullable|string',
|
||||
]);
|
||||
|
||||
// Use existing welder assignment logic
|
||||
$qualifiedWelders = $this->filterQualifiedWelders(
|
||||
$request->material_1,
|
||||
$request->material_2,
|
||||
$request->welding_method
|
||||
);
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'data' => $qualifiedWelders
|
||||
]);
|
||||
}
|
||||
```
|
||||
|
||||
### 6. Performance Optimization
|
||||
|
||||
**Client-Side:**
|
||||
- Debounce API calls (300ms)
|
||||
- Cache API responses
|
||||
- Use virtual scrolling for large lists
|
||||
- Lazy load widget modal
|
||||
- Use requestAnimationFrame for animations
|
||||
|
||||
**Server-Side:**
|
||||
- Use database indexes
|
||||
- Implement query caching
|
||||
- Use eager loading for relationships
|
||||
- Implement pagination
|
||||
- Use database transactions efficiently
|
||||
|
||||
### 7. Error Handling
|
||||
|
||||
**Client-Side:**
|
||||
```javascript
|
||||
async function saveJointData(jointData) {
|
||||
try {
|
||||
const response = await fetch('/api/pdf-editor/joint-data', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': csrfToken
|
||||
},
|
||||
body: JSON.stringify(jointData)
|
||||
});
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
if (!result.success) {
|
||||
throw new Error(result.message || 'Failed to save joint data');
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
console.error('Error saving joint data:', error);
|
||||
Swal.fire('Error', error.message, 'error');
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Server-Side:**
|
||||
```php
|
||||
try {
|
||||
// ... operation
|
||||
} catch (ValidationException $e) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Validation failed',
|
||||
'errors' => $e->errors()
|
||||
], 422);
|
||||
} catch (\Exception $e) {
|
||||
Log::error('Joint data save failed', [
|
||||
'error' => $e->getMessage(),
|
||||
'trace' => $e->getTraceAsString()
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'An error occurred while saving joint data'
|
||||
], 500);
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Testing Strategy
|
||||
|
||||
### Unit Tests
|
||||
- JointDataManager class methods
|
||||
- API endpoint validation
|
||||
- Database operations
|
||||
- Data mapping functions
|
||||
|
||||
### Integration Tests
|
||||
- Widget open/close flow
|
||||
- Data save/load cycle
|
||||
- API endpoint integration
|
||||
- Database transaction rollback
|
||||
|
||||
### E2E Tests
|
||||
- Complete joint creation flow
|
||||
- Welder assignment flow
|
||||
- Drawing generation from data
|
||||
- Document Revision save
|
||||
|
||||
---
|
||||
|
||||
## 📝 Implementation Checklist
|
||||
|
||||
### Phase 1: Foundation
|
||||
- [ ] Create JointDataManager class
|
||||
- [ ] Enhance joint widget modal
|
||||
- [ ] Add IC Log member selection
|
||||
- [ ] Implement auto-fill logic
|
||||
|
||||
### Phase 2: Integration
|
||||
- [ ] Add shape click handlers
|
||||
- [ ] Implement widget positioning
|
||||
- [ ] Connect widget to data manager
|
||||
- [ ] Update shape labels
|
||||
|
||||
### Phase 3: Backend
|
||||
- [ ] Enhance saveJointData endpoint
|
||||
- [ ] Create getQualifiedWelders endpoint
|
||||
- [ ] Implement Base Weldmap integration
|
||||
- [ ] Implement Weldlog integration
|
||||
|
||||
### Phase 4: Two-Way Sync
|
||||
- [ ] Create check-existing-weldmap endpoint
|
||||
- [ ] Implement left panel activation
|
||||
- [ ] Create drawing from data
|
||||
- [ ] Handle welder display
|
||||
|
||||
### Phase 5: Document Revision
|
||||
- [ ] Implement Spool Iso save
|
||||
- [ ] Implement As-Build save
|
||||
- [ ] Add versioning support
|
||||
|
||||
### Phase 6: Welder Filtering
|
||||
- [ ] Integrate qualification system
|
||||
- [ ] Implement material filtering
|
||||
- [ ] Add expiry date checking
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Next Steps
|
||||
|
||||
1. **Review and approve roadmap**
|
||||
2. **Set up development branch:** `feature/pdf-editor-step3-joint-widget`
|
||||
3. **Start with Phase 1:** Foundation & Data Structure
|
||||
4. **Iterative development:** Test each phase before moving to next
|
||||
5. **Code review:** After each phase completion
|
||||
|
||||
---
|
||||
|
||||
## 📖 References
|
||||
|
||||
- Existing Code:
|
||||
- `app/Http/Controllers/Api/AnnotationController.php`
|
||||
- `app/Http/Controllers/Api/PdfEditorLookupController.php`
|
||||
- `resources/views/components/modals/joint-widget-modal.blade.php`
|
||||
- `app/Http/Controllers/AutoCompleteType/welder-assignment/welder_1.php`
|
||||
|
||||
- Database Tables:
|
||||
- `weld_logs` - Main joint and welder data
|
||||
- `annotations` - PDF shape data
|
||||
- `document_revisions` - PDF file storage
|
||||
- `incoming_control` - IC Log member data
|
||||
- `material_group_map` - Material compatibility
|
||||
- `welder_tests` - Welder qualifications
|
||||
|
||||
---
|
||||
|
||||
**Document Version:** 1.0
|
||||
**Last Updated:** 2025-01-XX
|
||||
**Author:** Development Team
|
||||
|
||||
@@ -1,359 +0,0 @@
|
||||
# Queue Management Guide - viksa2
|
||||
|
||||
## Overview
|
||||
|
||||
The viksa2 application uses separate queue channels to ensure that different types of jobs don't block each other. This architecture allows heavy, long-running jobs and quick, short-running jobs to execute in parallel without interference.
|
||||
|
||||
## Queue Architecture
|
||||
|
||||
### Queue Channels
|
||||
|
||||
We have three separate queue channels configured:
|
||||
|
||||
1. **`default`** - General purpose queue for miscellaneous jobs
|
||||
2. **`register-creator`** - Dedicated queue for RegisterCreatorJob (heavy, long-running operations)
|
||||
3. **`save-trigger`** - Dedicated queue for ExecuteSaveTriggerJob (quick trigger execution)
|
||||
|
||||
### Configuration
|
||||
|
||||
All queue configurations are defined in `config/queue.php`:
|
||||
|
||||
```php
|
||||
'register-creator' => [
|
||||
'driver' => 'database',
|
||||
'table' => 'jobs',
|
||||
'queue' => 'register-creator',
|
||||
'retry_after' => 3600, // 1 hour timeout for long-running operations
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'save-trigger' => [
|
||||
'driver' => 'database',
|
||||
'table' => 'jobs',
|
||||
'queue' => 'save-trigger',
|
||||
'retry_after' => 90, // 90 seconds for quick trigger execution
|
||||
'after_commit' => false,
|
||||
],
|
||||
```
|
||||
|
||||
## Job Configuration
|
||||
|
||||
### RegisterCreatorJob
|
||||
|
||||
- **Queue**: `register-creator`
|
||||
- **Timeout**: 3600 seconds (1 hour)
|
||||
- **Retry Attempts**: 3
|
||||
- **Workers**: 2 processes
|
||||
|
||||
This job handles heavy PDF generation and Excel processing operations. It's configured to run for extended periods without timing out.
|
||||
|
||||
**Location**: `app/Jobs/RegisterCreatorJob.php`
|
||||
|
||||
```php
|
||||
public $queue = 'register-creator';
|
||||
public int $tries = 3;
|
||||
public int $timeout = 3600;
|
||||
```
|
||||
|
||||
### ExecuteSaveTriggerJob
|
||||
|
||||
- **Queue**: `save-trigger`
|
||||
- **Timeout**: 300 seconds (5 minutes)
|
||||
- **Retry Attempts**: 3
|
||||
- **Workers**: 4 processes
|
||||
|
||||
This job handles quick database trigger executions. Multiple workers ensure fast processing of trigger operations.
|
||||
|
||||
**Location**: `app/Jobs/ExecuteSaveTriggerJob.php`
|
||||
|
||||
```php
|
||||
public $queue = 'save-trigger';
|
||||
```
|
||||
|
||||
## Supervisor Configuration
|
||||
|
||||
Supervisor manages the queue workers as persistent background processes. The configuration is located at:
|
||||
`/etc/supervisor/conf.d/laravel-worker.conf`
|
||||
|
||||
### Worker Processes
|
||||
|
||||
#### Default Worker
|
||||
```ini
|
||||
[program:viksa2-worker]
|
||||
command=php /var/www/html/viksa2/artisan queue:work --queue=default
|
||||
numprocs=1
|
||||
```
|
||||
|
||||
#### Register Creator Worker
|
||||
```ini
|
||||
[program:viksa2-register-creator]
|
||||
command=php /var/www/html/viksa2/artisan queue:work --queue=register-creator
|
||||
numprocs=2
|
||||
timeout=3600
|
||||
```
|
||||
- Runs 2 parallel processes
|
||||
- Designed for long-running operations
|
||||
|
||||
#### Save Trigger Worker
|
||||
```ini
|
||||
[program:viksa2-save-trigger]
|
||||
command=php /var/www/html/viksa2/artisan queue:work --queue=save-trigger
|
||||
numprocs=4
|
||||
timeout=300
|
||||
```
|
||||
- Runs 4 parallel processes
|
||||
- Designed for quick execution with high throughput
|
||||
|
||||
## Management Commands
|
||||
|
||||
### Supervisor Commands
|
||||
|
||||
```bash
|
||||
# Reload supervisor configuration
|
||||
sudo supervisorctl reread
|
||||
|
||||
# Update supervisor with new configuration
|
||||
sudo supervisorctl update
|
||||
|
||||
# Start all viksa2 workers
|
||||
sudo supervisorctl start viksa2-worker:*
|
||||
sudo supervisorctl start viksa2-register-creator:*
|
||||
sudo supervisorctl start viksa2-save-trigger:*
|
||||
|
||||
# Stop all viksa2 workers
|
||||
sudo supervisorctl stop viksa2-worker:*
|
||||
sudo supervisorctl stop viksa2-register-creator:*
|
||||
sudo supervisorctl stop viksa2-save-trigger:*
|
||||
|
||||
# Restart all viksa2 workers
|
||||
sudo supervisorctl restart viksa2-worker:*
|
||||
sudo supervisorctl restart viksa2-register-creator:*
|
||||
sudo supervisorctl restart viksa2-save-trigger:*
|
||||
|
||||
# Check status
|
||||
sudo supervisorctl status
|
||||
|
||||
# Restart individual worker group
|
||||
sudo supervisorctl restart viksa2-register-creator:*
|
||||
```
|
||||
|
||||
### Queue Monitoring
|
||||
|
||||
```bash
|
||||
# Monitor queue status
|
||||
php artisan queue:monitor register-creator,save-trigger,default --max=100
|
||||
|
||||
# List failed jobs
|
||||
php artisan queue:failed
|
||||
|
||||
# Retry all failed jobs
|
||||
php artisan queue:retry all
|
||||
|
||||
# Retry specific failed job
|
||||
php artisan queue:retry {job-id}
|
||||
|
||||
# Clear all failed jobs
|
||||
php artisan queue:flush
|
||||
|
||||
# Check queue statistics
|
||||
php artisan queue:work --once --queue=register-creator
|
||||
|
||||
# Process only one job (useful for testing)
|
||||
php artisan queue:work --once --queue=save-trigger
|
||||
```
|
||||
|
||||
### Log Monitoring
|
||||
|
||||
```bash
|
||||
# Watch register creator worker logs
|
||||
tail -f /var/www/html/viksa2/storage/logs/register-creator-worker.log
|
||||
|
||||
# Watch save trigger worker logs
|
||||
tail -f /var/www/html/viksa2/storage/logs/save-trigger-worker.log
|
||||
|
||||
# Watch general worker logs
|
||||
tail -f /var/www/html/viksa2/storage/logs/worker.log
|
||||
|
||||
# Watch Laravel application logs
|
||||
tail -f /var/www/html/viksa2/storage/logs/laravel.log
|
||||
|
||||
# Watch all worker logs simultaneously
|
||||
tail -f /var/www/html/viksa2/storage/logs/*-worker.log
|
||||
```
|
||||
|
||||
## Deployment Workflow
|
||||
|
||||
When deploying changes that affect jobs:
|
||||
|
||||
```bash
|
||||
# 1. Pull latest code
|
||||
cd /var/www/html/viksa2
|
||||
git pull
|
||||
|
||||
# 2. Update dependencies (if needed)
|
||||
composer install --no-dev --optimize-autoloader
|
||||
|
||||
# 3. Clear caches
|
||||
php artisan config:clear
|
||||
php artisan cache:clear
|
||||
php artisan queue:restart
|
||||
|
||||
# 4. Restart supervisor workers
|
||||
sudo supervisorctl restart viksa2-worker:*
|
||||
sudo supervisorctl restart viksa2-register-creator:*
|
||||
sudo supervisorctl restart viksa2-save-trigger:*
|
||||
|
||||
# 5. Verify workers are running
|
||||
sudo supervisorctl status | grep viksa2
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Workers Not Processing Jobs
|
||||
|
||||
```bash
|
||||
# Check if workers are running
|
||||
sudo supervisorctl status | grep viksa2
|
||||
|
||||
# Check if jobs are queued in database
|
||||
mysql -e "SELECT * FROM viksa2_db.jobs ORDER BY id DESC LIMIT 10;"
|
||||
|
||||
# Check worker logs for errors
|
||||
tail -100 /var/www/html/viksa2/storage/logs/register-creator-worker.log
|
||||
tail -100 /var/www/html/viksa2/storage/logs/save-trigger-worker.log
|
||||
```
|
||||
|
||||
### High Memory Usage
|
||||
|
||||
If workers consume too much memory:
|
||||
|
||||
```bash
|
||||
# Add memory limit to worker command in supervisor config
|
||||
command=php -d memory_limit=2048M /var/www/html/viksa2/artisan queue:work
|
||||
|
||||
# Or set max-time to restart workers periodically
|
||||
command=php /var/www/html/viksa2/artisan queue:work --max-time=3600
|
||||
```
|
||||
|
||||
### Job Timeouts
|
||||
|
||||
If jobs are timing out:
|
||||
|
||||
1. Increase `timeout` in job class
|
||||
2. Increase `retry_after` in queue config
|
||||
3. Increase `stopwaitsecs` in supervisor config
|
||||
|
||||
### Failed Jobs
|
||||
|
||||
```bash
|
||||
# View failed job details
|
||||
php artisan queue:failed
|
||||
|
||||
# Retry failed jobs
|
||||
php artisan queue:retry all
|
||||
|
||||
# Delete failed jobs older than 48 hours
|
||||
php artisan queue:prune-failed --hours=48
|
||||
```
|
||||
|
||||
## Performance Tuning
|
||||
|
||||
### Adjust Worker Count
|
||||
|
||||
Based on server resources:
|
||||
|
||||
- **Low traffic**: 1 register-creator, 2 save-trigger
|
||||
- **Medium traffic**: 2 register-creator, 4 save-trigger (current)
|
||||
- **High traffic**: 4 register-creator, 8 save-trigger
|
||||
|
||||
Edit `/etc/supervisor/conf.d/laravel-worker.conf` and change `numprocs` value.
|
||||
|
||||
### Sleep Time Optimization
|
||||
|
||||
- `--sleep=1` for high-priority queues (save-trigger)
|
||||
- `--sleep=3` for normal queues (default, register-creator)
|
||||
- Lower values = more responsive, higher CPU usage
|
||||
|
||||
### Connection Pooling
|
||||
|
||||
For database driver, ensure sufficient database connections:
|
||||
|
||||
```
|
||||
Max Connections = (Workers × Processes) + Application Connections + Buffer
|
||||
```
|
||||
|
||||
Example: (3 worker groups × 7 total processes) + 20 app connections + 10 buffer = 51 connections
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Always use `queue:restart` after code changes** - Workers cache the application state
|
||||
2. **Monitor failed jobs regularly** - Set up alerts for failed job threshold
|
||||
3. **Use `--max-time` parameter** - Prevents memory leaks by restarting workers periodically
|
||||
4. **Separate heavy and light jobs** - Use dedicated queues for different job types
|
||||
5. **Log everything** - Use Laravel's logging extensively in job classes
|
||||
6. **Test with `--once` flag** - Test job execution before deploying to production
|
||||
7. **Set realistic timeouts** - Configure timeouts based on actual job execution times
|
||||
8. **Use job tags** - Makes debugging easier with Telescope or Horizon
|
||||
|
||||
## Queue Priority
|
||||
|
||||
If you need to process multiple queues with priority ordering:
|
||||
|
||||
```bash
|
||||
# Higher priority queues come first
|
||||
php artisan queue:work --queue=save-trigger,register-creator,default
|
||||
```
|
||||
|
||||
This ensures `save-trigger` jobs are processed before `register-creator` jobs.
|
||||
|
||||
## Monitoring Tools
|
||||
|
||||
### Laravel Horizon (Optional)
|
||||
|
||||
For advanced queue monitoring, consider installing Laravel Horizon:
|
||||
|
||||
```bash
|
||||
composer require laravel/horizon
|
||||
php artisan horizon:install
|
||||
php artisan migrate
|
||||
```
|
||||
|
||||
Horizon provides a beautiful dashboard at `/horizon` with real-time queue metrics.
|
||||
|
||||
### Telescope (Optional)
|
||||
|
||||
Laravel Telescope provides insights into job execution:
|
||||
|
||||
```bash
|
||||
composer require laravel/telescope --dev
|
||||
php artisan telescope:install
|
||||
php artisan migrate
|
||||
```
|
||||
|
||||
Access the dashboard at `/telescope` to view job execution details.
|
||||
|
||||
## Related Files
|
||||
|
||||
- **Job Classes**: `app/Jobs/RegisterCreatorJob.php`, `app/Jobs/ExecuteSaveTriggerJob.php`
|
||||
- **Queue Config**: `config/queue.php`
|
||||
- **Supervisor Config**: `/etc/supervisor/conf.d/laravel-worker.conf`
|
||||
- **Worker Logs**: `/var/www/html/viksa2/storage/logs/*-worker.log`
|
||||
- **Controllers**:
|
||||
- `app/Http/Controllers/RegisterCreatorController.php` (dispatches RegisterCreatorJob)
|
||||
- `app/Http/Controllers/AdminController.php` (dispatches ExecuteSaveTriggerJob)
|
||||
|
||||
## Support
|
||||
|
||||
For issues or questions about queue management, refer to:
|
||||
- Laravel Queue Documentation: https://laravel.com/docs/queues
|
||||
- Supervisor Documentation: http://supervisord.org/
|
||||
- Project Documentation: `resources/views/guide/`
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: October 10, 2025
|
||||
**Author**: DevQMS Team
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
# Register Creator Queue System - Fix Summary
|
||||
|
||||
## Problem Identified
|
||||
|
||||
The Register Creator queue system was experiencing the following issues:
|
||||
|
||||
1. **RegisterCreatorJob failing immediately** - Jobs were being processed but failing without clear error messages
|
||||
2. **No progress updates** - Progress tracking wasn't working in queue context
|
||||
3. **Auth context missing** - `Auth::user()` was being called in queue workers where no authenticated user exists
|
||||
4. **Slow PDF processing** - `pdftk` commands were running without timeout, potentially hanging the system
|
||||
|
||||
## Root Causes
|
||||
|
||||
### 1. Authentication Context Issue
|
||||
The `ProgressTracker` class was calling `Auth::user()` in its `addToQueue()` method. In queue worker context, there's no authenticated user, causing the job to fail.
|
||||
|
||||
### 2. Missing User ID in Job Dispatch
|
||||
The `RegisterCreatorJob` wasn't receiving the user ID, making it impossible to track who initiated the job.
|
||||
|
||||
### 3. Inefficient PDF Page Counting
|
||||
The `addRowInTable` function was using `shell_exec` to run `pdftk` commands without:
|
||||
- Timeout protection (could hang indefinitely)
|
||||
- Caching (same files were being checked multiple times)
|
||||
- Error output suppression
|
||||
|
||||
### 4. Progress Updates Not Visible
|
||||
Progress updates weren't showing proper percentage or status information.
|
||||
|
||||
## Solutions Implemented
|
||||
|
||||
### 1. Fixed ProgressTracker Authentication (app/Services/RegisterCreator/ProgressTracker.php)
|
||||
```php
|
||||
// Before: Would crash in queue context
|
||||
$user = Auth::user();
|
||||
|
||||
// After: Gracefully handles missing auth context
|
||||
try {
|
||||
$user = Auth::user();
|
||||
} catch (\Throwable $th) {
|
||||
$user = null;
|
||||
Log::warning("Could not get authenticated user in queue context");
|
||||
}
|
||||
```
|
||||
|
||||
### 2. Added User ID to RegisterCreatorJob (app/Jobs/RegisterCreatorJob.php)
|
||||
```php
|
||||
// Added userId property
|
||||
public int $userId;
|
||||
|
||||
// Constructor now accepts user ID
|
||||
public function __construct(array $jobData, int $userId = null)
|
||||
{
|
||||
$this->jobData = $jobData;
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
// User ID is now logged and tracked
|
||||
$settings['tracking_user_id'] = $this->userId;
|
||||
```
|
||||
|
||||
### 3. Updated Job Dispatch (app/Http/Controllers/RegisterCreatorController.php)
|
||||
```php
|
||||
// Now passes user ID when dispatching
|
||||
RegisterCreatorJob::dispatch($jobData, $u->id);
|
||||
```
|
||||
|
||||
### 4. Optimized PDF Page Counting (app/Functions/addRowInTable.php)
|
||||
```php
|
||||
// Added timeout to prevent hanging
|
||||
$command = "timeout 5 pdftk {$allPath} dump_data 2>/dev/null | grep NumberOfPages";
|
||||
|
||||
// Added caching to prevent redundant checks
|
||||
static $pageCountCache = [];
|
||||
if (isset($pageCountCache[$cacheKey])) {
|
||||
$pageCount = $pageCountCache[$cacheKey];
|
||||
}
|
||||
```
|
||||
|
||||
### 5. Enhanced Progress Updates (app/Services/RegisterCreator/RegisterCreatorService.php)
|
||||
```php
|
||||
// Now shows actual percentage and detailed descriptions
|
||||
$progressPercent = (int) (($index + 1) / count($documents) * 100);
|
||||
$this->progressTracker->update(
|
||||
"Processing document {$index + 1}/{$total}: {$docTitle}",
|
||||
$progressPercent
|
||||
);
|
||||
```
|
||||
|
||||
### 6. Added Error Resilience (app/Services/RegisterCreator/ProgressTracker.php)
|
||||
```php
|
||||
// Progress tracking failures won't stop the job
|
||||
try {
|
||||
Cache::put("register-creator-progress-{$this->jobId}", $progressData, ...);
|
||||
} catch (\Throwable $th) {
|
||||
Log::error("Failed to update progress...");
|
||||
}
|
||||
```
|
||||
|
||||
## Queue Worker Configuration
|
||||
|
||||
Started a dedicated queue worker with extended timeouts:
|
||||
|
||||
```bash
|
||||
nohup php artisan queue:work database \
|
||||
--timeout=7200 \
|
||||
--tries=3 \
|
||||
--sleep=3 \
|
||||
--max-time=7200 \
|
||||
> /var/www/html/stellar2/storage/logs/queue-worker.log 2>&1 &
|
||||
```
|
||||
|
||||
Parameters:
|
||||
- `--timeout=7200`: Job can run up to 2 hours
|
||||
- `--tries=3`: Retry failed jobs up to 3 times
|
||||
- `--sleep=3`: Wait 3 seconds between jobs
|
||||
- `--max-time=7200`: Worker restarts after 2 hours
|
||||
|
||||
## Testing & Verification
|
||||
|
||||
To test the fixes:
|
||||
|
||||
1. **Check if queue worker is running:**
|
||||
```bash
|
||||
ps aux | grep "queue:work"
|
||||
```
|
||||
|
||||
2. **Monitor queue worker log:**
|
||||
```bash
|
||||
tail -f /var/www/html/stellar2/storage/logs/queue-worker.log
|
||||
```
|
||||
|
||||
3. **Check job progress:**
|
||||
```bash
|
||||
php artisan tinker
|
||||
Cache::get('register-creator-queue')
|
||||
```
|
||||
|
||||
4. **Monitor Laravel logs:**
|
||||
```bash
|
||||
tail -f /var/www/html/stellar2/storage/logs/truncgil-$(date +%Y-%m-%d).log | grep -i register
|
||||
```
|
||||
|
||||
## Performance Improvements
|
||||
|
||||
1. **PDF Processing:** 5-second timeout prevents indefinite hanging
|
||||
2. **Caching:** Page counts are cached, reducing redundant `pdftk` calls
|
||||
3. **Progress Updates:** More informative with actual percentages
|
||||
4. **Error Handling:** Jobs continue even if progress tracking fails
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. Monitor the queue worker for the next few hours
|
||||
2. Check that progress updates are appearing in the UI
|
||||
3. Verify that jobs complete successfully
|
||||
4. Review Laravel logs for any new errors
|
||||
5. Consider adding Redis for better queue performance (optional)
|
||||
|
||||
## Additional Notes
|
||||
|
||||
- All code comments and text messages are in English as per project requirements
|
||||
- The system now handles missing authentication context gracefully
|
||||
- PDF processing has timeout protection to prevent hanging
|
||||
- Progress tracking is non-blocking and won't stop job execution if it fails
|
||||
|
||||
@@ -1,339 +0,0 @@
|
||||
# Register Creator Jobs System - Documentation
|
||||
|
||||
## 📋 Overview
|
||||
|
||||
New modular, queue-based Register Creator system using Laravel Jobs and Services. This replaces the old cache-based system with a modern, SOLID-principles architecture.
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
```
|
||||
Frontend (register-creator-2.blade.php)
|
||||
↓ AJAX Request
|
||||
Admin-AJAX Endpoint (register-creator-dispatch-jobs.blade.php)
|
||||
↓ Dispatches Jobs
|
||||
RegisterCreatorJob (Queue)
|
||||
↓ Orchestrates
|
||||
RegisterCreatorService (Coordinator)
|
||||
↓ Uses
|
||||
Document Processors (Factory Pattern)
|
||||
├─ QaDocumentProcessor
|
||||
├─ WdbDocumentProcessor
|
||||
├─ TemplateProcessor
|
||||
└─ ... (10+ processors)
|
||||
```
|
||||
|
||||
## 📁 File Structure
|
||||
|
||||
```
|
||||
app/
|
||||
├── Jobs/
|
||||
│ └── RegisterCreatorJob.php # Main job class
|
||||
├── Services/
|
||||
│ └── RegisterCreator/
|
||||
│ ├── RegisterCreatorService.php # Main coordinator
|
||||
│ ├── ExcelHandler.php # Excel operations
|
||||
│ ├── PdfConverter.php # PDF conversion
|
||||
│ ├── PlaceholderReplacer.php # Placeholder handling
|
||||
│ ├── ProgressTracker.php # Progress tracking
|
||||
│ └── DocumentProcessors/
|
||||
│ ├── AbstractDocumentProcessor.php # Base processor
|
||||
│ ├── DocumentProcessorFactory.php # Factory pattern
|
||||
│ ├── QaDocumentProcessor.php
|
||||
│ ├── WdbDocumentProcessor.php
|
||||
│ ├── TemplateProcessor.php
|
||||
│ ├── DrawingsProcessor.php
|
||||
│ ├── MaterialsProcessor.php
|
||||
│ ├── IncomingControlProcessor.php
|
||||
│ ├── PrikazProcessor.php
|
||||
│ ├── WpsNaksTechnologyProcessor.php
|
||||
│ ├── NaksConsumablesCertificateProcessor.php
|
||||
│ ├── NaksConsumablesInspectionProcessor.php
|
||||
│ ├── DocumentProcedureProcessor.php
|
||||
│ └── GenericDocumentProcessor.php
|
||||
|
||||
resources/views/
|
||||
├── admin/type/
|
||||
│ └── register-creator-2.blade.php # Frontend (updated)
|
||||
└── admin-ajax/
|
||||
└── register-creator-dispatch-jobs.blade.php # New AJAX endpoint
|
||||
```
|
||||
|
||||
## 🚀 Installation & Setup
|
||||
|
||||
### 1. Queue Configuration
|
||||
|
||||
Add to `.env`:
|
||||
```env
|
||||
QUEUE_CONNECTION=database
|
||||
```
|
||||
|
||||
Run migration for queue table:
|
||||
```bash
|
||||
php artisan queue:table
|
||||
php artisan migrate
|
||||
```
|
||||
|
||||
### 2. Start Queue Worker
|
||||
|
||||
**Option A: Supervisor (Production - Recommended)**
|
||||
|
||||
Create supervisor config: `/etc/supervisor/conf.d/register-creator.conf`
|
||||
```ini
|
||||
[program:register-creator-worker]
|
||||
process_name=%(program_name)s_%(process_num)02d
|
||||
command=php /var/www/html/stellar2/artisan queue:work --queue=register-creator --sleep=3 --tries=3 --timeout=3600
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=www-data
|
||||
numprocs=2
|
||||
redirect_stderr=true
|
||||
stdout_logfile=/var/www/html/stellar2/storage/logs/queue-worker.log
|
||||
stopwaitsecs=3600
|
||||
```
|
||||
|
||||
Restart supervisor:
|
||||
```bash
|
||||
sudo supervisorctl reread
|
||||
sudo supervisorctl update
|
||||
sudo supervisorctl start register-creator-worker:*
|
||||
```
|
||||
|
||||
**Option B: Artisan Command (Development)**
|
||||
```bash
|
||||
php artisan queue:work --queue=register-creator --tries=3 --timeout=3600
|
||||
```
|
||||
|
||||
### 3. Verify Installation
|
||||
|
||||
Check if queue is working:
|
||||
```bash
|
||||
php artisan queue:listen --queue=register-creator --timeout=3600
|
||||
```
|
||||
|
||||
## 💡 Usage
|
||||
|
||||
### Frontend (Same as Before)
|
||||
|
||||
1. Select documents from left panel
|
||||
2. Select lines from DataGrid
|
||||
3. Click "Generate Register of Selected"
|
||||
4. Jobs are dispatched to queue
|
||||
|
||||
### Monitoring Jobs
|
||||
|
||||
**Check queue status:**
|
||||
```bash
|
||||
php artisan queue:work --queue=register-creator --once
|
||||
```
|
||||
|
||||
**Failed jobs:**
|
||||
```bash
|
||||
php artisan queue:failed
|
||||
```
|
||||
|
||||
**Retry failed job:**
|
||||
```bash
|
||||
php artisan queue:retry <job-id>
|
||||
```
|
||||
|
||||
**Clear failed jobs:**
|
||||
```bash
|
||||
php artisan queue:flush
|
||||
```
|
||||
|
||||
## 🔍 How It Works
|
||||
|
||||
### 1. Job Dispatch Flow
|
||||
|
||||
```php
|
||||
// User clicks button → AJAX request
|
||||
$.post("?ajax=register-creator-dispatch-jobs", {
|
||||
lines: [...], // Selected rows
|
||||
documents: [...], // Selected documents
|
||||
override: true
|
||||
})
|
||||
|
||||
// Backend dispatches jobs
|
||||
foreach ($lines as $line) {
|
||||
RegisterCreatorJob::dispatch([
|
||||
'line_data' => $line,
|
||||
'documents' => $documents,
|
||||
'settings' => [...]
|
||||
])->onQueue('register-creator');
|
||||
}
|
||||
```
|
||||
|
||||
### 2. Job Execution
|
||||
|
||||
```php
|
||||
RegisterCreatorJob::handle()
|
||||
→ RegisterCreatorService::processLine()
|
||||
→ Load Excel template
|
||||
→ Replace placeholders
|
||||
→ foreach(documents as $document)
|
||||
→ DocumentProcessorFactory::make($document['type'])
|
||||
→ Processor::process()
|
||||
→ Search files
|
||||
→ Add rows to Excel
|
||||
→ Save Excel
|
||||
→ Convert to PDF
|
||||
→ Update progress
|
||||
```
|
||||
|
||||
### 3. Document Type Processing
|
||||
|
||||
Each document type has its own processor:
|
||||
|
||||
| Type | Processor | Description |
|
||||
|------|-----------|-------------|
|
||||
| `qa` | QaDocumentProcessor | NDT reports, procedures |
|
||||
| `wdb` | WdbDocumentProcessor | WPS, WPQ, Naks certificates |
|
||||
| `template` | TemplateProcessor | Template documents |
|
||||
| `drawings` | DrawingsProcessor | Drawing files |
|
||||
| `materials` | MaterialsProcessor | Material certificates |
|
||||
| `incoming_control_materials` | IncomingControlProcessor | Incoming control |
|
||||
| `prikaz` | PrikazProcessor | Work permits |
|
||||
| `wps_naks_technology` | WpsNaksTechnologyProcessor | WPS Naks certs |
|
||||
| ... | ... | ... |
|
||||
|
||||
## 🎯 Benefits
|
||||
|
||||
### ✅ Advantages Over Old System
|
||||
|
||||
1. **SOLID Principles**: Each class has single responsibility
|
||||
2. **Laravel Queue**: Built-in retry, failure handling, monitoring
|
||||
3. **Parallel Processing**: Multiple workers can run simultaneously
|
||||
4. **Error Isolation**: One line failure doesn't affect others
|
||||
5. **Testable**: Each service can be unit tested
|
||||
6. **Maintainable**: Easy to add new document types
|
||||
7. **Scalable**: Can add more workers as needed
|
||||
8. **Progress Tracking**: Real-time progress via Cache
|
||||
9. **Email Notifications**: Success/failure notifications
|
||||
|
||||
### 📊 Performance
|
||||
|
||||
- **Old System**: Sequential processing, blocks server
|
||||
- **New System**: Asynchronous, non-blocking, parallel
|
||||
|
||||
## 🐛 Debugging
|
||||
|
||||
### Enable Debug Logging
|
||||
|
||||
```php
|
||||
// In RegisterCreatorJob
|
||||
Log::info("Job started", ['line' => $lineIdentifier]);
|
||||
```
|
||||
|
||||
### Check Logs
|
||||
|
||||
```bash
|
||||
tail -f storage/logs/laravel.log
|
||||
tail -f storage/logs/queue-worker.log
|
||||
```
|
||||
|
||||
### Progress Tracking
|
||||
|
||||
Progress is stored in Cache:
|
||||
```php
|
||||
Cache::get("register-creator-progress-{$jobId}")
|
||||
```
|
||||
|
||||
## 🔧 Maintenance
|
||||
|
||||
### Add New Document Type
|
||||
|
||||
1. Create processor:
|
||||
```php
|
||||
// app/Services/RegisterCreator/DocumentProcessors/MyNewProcessor.php
|
||||
class MyNewProcessor extends AbstractDocumentProcessor {
|
||||
public function process(...) {
|
||||
// Implementation
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. Add to factory:
|
||||
```php
|
||||
// DocumentProcessorFactory.php
|
||||
return match($type) {
|
||||
'my_new_type' => new MyNewProcessor(),
|
||||
// ...
|
||||
};
|
||||
```
|
||||
|
||||
### Extend Functionality
|
||||
|
||||
All processors extend `AbstractDocumentProcessor` which provides:
|
||||
- File search helper
|
||||
- Log writing
|
||||
- Contractor lookup
|
||||
- Common utilities
|
||||
|
||||
## 📝 Configuration
|
||||
|
||||
### Settings
|
||||
|
||||
- `register_creator_start_row`: Template row in Excel (default: 16)
|
||||
- `register_creator_column_based`: Column to group by (default: 'line_number')
|
||||
- `register_creator_path`: Base path for documents
|
||||
|
||||
### Job Settings
|
||||
|
||||
- **Tries**: 3 (configurable in RegisterCreatorJob)
|
||||
- **Timeout**: 3600 seconds (1 hour)
|
||||
- **Queue**: `register-creator`
|
||||
|
||||
## 🚨 Troubleshooting
|
||||
|
||||
### Jobs Not Processing
|
||||
|
||||
```bash
|
||||
# Check if queue worker is running
|
||||
ps aux | grep queue:work
|
||||
|
||||
# Start manually
|
||||
php artisan queue:work --queue=register-creator
|
||||
```
|
||||
|
||||
### Memory Issues
|
||||
|
||||
```bash
|
||||
# Increase memory limit in Job
|
||||
ini_set('memory_limit', '2048M');
|
||||
```
|
||||
|
||||
### Failed Jobs
|
||||
|
||||
```bash
|
||||
# List failed jobs
|
||||
php artisan queue:failed
|
||||
|
||||
# Retry specific job
|
||||
php artisan queue:retry <job-id>
|
||||
|
||||
# Retry all
|
||||
php artisan queue:retry all
|
||||
```
|
||||
|
||||
## 📞 Support
|
||||
|
||||
For issues or questions:
|
||||
1. Check Laravel logs: `storage/logs/laravel.log`
|
||||
2. Check queue logs: `storage/logs/queue-worker.log`
|
||||
3. Check line-specific logs: `storage/documents/{path}/{line}/log.txt`
|
||||
|
||||
## 🎓 Best Practices
|
||||
|
||||
1. **Always run queue worker** in production
|
||||
2. **Use Supervisor** for automatic restarts
|
||||
3. **Monitor failed jobs** regularly
|
||||
4. **Check memory usage** on long-running jobs
|
||||
5. **Test with small batches** first
|
||||
6. **Backup before major updates**
|
||||
|
||||
---
|
||||
|
||||
**Created**: {{ date('Y-m-d') }}
|
||||
**Version**: 2.0
|
||||
**Status**: Production Ready ✅
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
# AI SQL Builder User Guide
|
||||
|
||||
## What is the AI SQL Builder Module?
|
||||
|
||||
The AI SQL Builder module is an intelligent tool that helps users create SQL queries using natural language processing. It allows users to generate complex database queries without needing extensive SQL knowledge.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access AI SQL Builder:
|
||||
1. Login to the system
|
||||
2. Click on **Settings** in the main menu
|
||||
3. Select **AI SQL Builder** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Natural Language Query Generation**: Convert plain English to SQL queries
|
||||
- **Query Optimization**: Automatically optimize generated queries for better performance
|
||||
- **Query Validation**: Validate SQL syntax before execution
|
||||
- **Query History**: Save and reuse previously generated queries
|
||||
|
||||
### Secondary Functions
|
||||
- **Query Templates**: Pre-built query templates for common operations
|
||||
- **Export Results**: Export query results to various formats
|
||||
- **Query Sharing**: Share queries with team members
|
||||
|
||||
## How to Use
|
||||
|
||||
### Creating a New Query
|
||||
1. Click **"New Query"** button
|
||||
2. Enter your question in natural language
|
||||
3. Select the target database/tables
|
||||
4. Click **"Generate SQL"**
|
||||
5. Review the generated query
|
||||
6. Click **"Execute"** to run the query
|
||||
|
||||
### Example Queries
|
||||
- "Show me all welders who completed their qualification in the last 6 months"
|
||||
- "Find all NDT tests that failed inspection"
|
||||
- "List projects with pending RFI responses"
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Use clear, specific language when describing your query
|
||||
- ✅ Specify date ranges and conditions clearly
|
||||
- ✅ Review generated queries before execution
|
||||
- ✅ Use query templates for common operations
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Always validate queries before running on production data
|
||||
- ✅ Test queries on sample data first
|
||||
- ✅ Keep queries simple and readable
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Query not generating**: Check your natural language description for clarity
|
||||
2. **Incorrect results**: Review the generated SQL and modify if needed
|
||||
3. **Performance issues**: Use query optimization features
|
||||
|
||||
### Getting Help
|
||||
- Contact the IT department for technical support
|
||||
- Consult the database administrator for complex queries
|
||||
- Check the query history for similar examples
|
||||
@@ -1,72 +0,0 @@
|
||||
# AKT Creator User Guide
|
||||
|
||||
## What is the AKT Creator Module?
|
||||
|
||||
The AKT Creator module is used for creating and managing AKT (Acceptance Test) documents. This module helps quality control teams generate acceptance test reports and manage test procedures for various project components.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access AKT Creator:
|
||||
1. Login to the system
|
||||
2. Click on **Main-Employees** in the main menu
|
||||
3. Select **AKT Creator** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **AKT Document Creation**: Generate new acceptance test documents
|
||||
- **Test Procedure Management**: Create and manage test procedures
|
||||
- **Result Recording**: Record test results and findings
|
||||
- **Document Templates**: Use pre-built templates for different test types
|
||||
|
||||
### Secondary Functions
|
||||
- **Test History**: Track previous test results
|
||||
- **Approval Workflow**: Manage approval processes
|
||||
- **Document Export**: Export AKT documents to PDF/Excel
|
||||
- **Notification System**: Alert relevant personnel about test status
|
||||
|
||||
## How to Use
|
||||
|
||||
### Creating a New AKT Document
|
||||
1. Click **"New AKT"** button
|
||||
2. Select the project and component
|
||||
3. Choose the appropriate test template
|
||||
4. Fill in test parameters and requirements
|
||||
5. Assign test personnel
|
||||
6. Set test schedule and location
|
||||
7. Click **"Create AKT"**
|
||||
|
||||
### Recording Test Results
|
||||
1. Open the AKT document
|
||||
2. Navigate to **"Test Results"** section
|
||||
3. Enter test measurements and observations
|
||||
4. Upload supporting documents/photos
|
||||
5. Mark test as **Pass/Fail**
|
||||
6. Add comments and recommendations
|
||||
7. Save and submit for approval
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Always verify test parameters before starting
|
||||
- ✅ Document all test conditions and environmental factors
|
||||
- ✅ Take clear photos of test setup and results
|
||||
- ✅ Follow standard test procedures exactly
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Double-check all measurements and calculations
|
||||
- ✅ Ensure all required signatures are obtained
|
||||
- ✅ Review test results before final submission
|
||||
- ✅ Maintain proper documentation standards
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Template not loading**: Check internet connection and refresh page
|
||||
2. **Cannot save document**: Verify all required fields are completed
|
||||
3. **Approval workflow stuck**: Contact the project manager
|
||||
|
||||
### Getting Help
|
||||
- Contact the Quality Control department
|
||||
- Consult the project manager for approval issues
|
||||
- Check the AKT template library for examples
|
||||
@@ -1,158 +0,0 @@
|
||||
# Available Endpoints
|
||||
|
||||
This document lists all available admin-ajax endpoints accessible via the API.
|
||||
|
||||
**Base URL:** `/api/endpoints/{endpoint}`
|
||||
|
||||
**Authentication:** Bearer Token required
|
||||
|
||||
---
|
||||
|
||||
## General
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `cache-views-list` | @api-readonly | json |
|
||||
| `column-history` | @api-readonly | json |
|
||||
| `crew-performance` | @api-readonly | json |
|
||||
| `developer-project-stats` | Execute Developer Project Stats endpoint | json |
|
||||
| `developer-team-stats` | Execute Developer Team Stats endpoint | json |
|
||||
| `disk-usage` | Execute Disk Usage endpoint | json |
|
||||
| `employees` | @api-readonly | json |
|
||||
| `general-inspection-list` | Execute General Inspection List endpoint | json |
|
||||
| `get-author-info` | @api-readonly | json |
|
||||
| `get-document-folders-simple` | @api-readonly | json |
|
||||
| `get-dynamic-documents` | @api-readonly | json |
|
||||
| `get-incoming-for-weldlog` | @api-readonly | json |
|
||||
| `hand-over-status` | @api-readonly | json |
|
||||
| `progress` | @api-readonly | json |
|
||||
| `repair-table/defect-type-by-welder` | @api-readonly | json |
|
||||
| `request-ndt-no-cache` | @api-readonly | json |
|
||||
|
||||
## Document Management
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `document-history` | @api-readonly | json |
|
||||
|
||||
## Materials
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `material-performance` | @api-readonly | json |
|
||||
|
||||
## NDT Operations
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `ndt-calculation` | @api-readonly | json |
|
||||
| `ndt-calculation-no-cache` | @api-readonly | json |
|
||||
| `ndt-dashboard` | @api-readonly | json |
|
||||
| `ndt-list` | @api-readonly | json |
|
||||
| `ndt-paint-list` | @api-readonly | json |
|
||||
| `ndt-paint-list-field` | @api-readonly | json |
|
||||
|
||||
## Paint Operations
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `paint-info` | @api-readonly | json |
|
||||
|
||||
## Register Creator
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `register-creator-progress-status` | @api-readonly | json |
|
||||
| `register-creator-progress-tracker` | Execute Register Creator Progress Tracker endpoint | html |
|
||||
| `register-creator-work-permit-placeholders` | @api-readonly | json |
|
||||
| `register-no-cache` | @api-readonly | json |
|
||||
| `register-tp` | @api-readonly | json |
|
||||
| `register-tp-detail` | @api-readonly | json |
|
||||
|
||||
## Repair Operations
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `repair-table` | @api-readonly | json |
|
||||
|
||||
## Reports
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `report-builder-get-table` | @api-readonly | json |
|
||||
| `report-builder-sql` | @api-readonly | json |
|
||||
|
||||
## RFI Operations
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `rfi-dashboard` | @api-readonly | json |
|
||||
| `rfi-tasks` | @api-readonly | json |
|
||||
|
||||
## System Info
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `si-queue-information` | @api-readonly | html |
|
||||
|
||||
## Spool Operations
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `spool-area-release` | @api-readonly | auto |
|
||||
| `spool-area-release-no-cache` | @api-readonly | json |
|
||||
| `spool-list-field` | @api-readonly | json |
|
||||
| `spool-list-no-cache` | @api-readonly | json |
|
||||
| `spool-release-detail` | @api-readonly | auto |
|
||||
|
||||
## Test Packages
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `tp-creator-progress-tracker` | Execute Tp Creator Progress Tracker endpoint | html |
|
||||
|
||||
## User Management
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `users` | @api-readonly | json |
|
||||
|
||||
## Welding
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `weld-line-comparator` | @api-readonly | json |
|
||||
|
||||
## Welder Management
|
||||
|
||||
| Endpoint | Description | Response Type |
|
||||
|----------|-------------|---------------|
|
||||
| `welder-id-cart` | @api-readonly | json |
|
||||
| `welder-performance` | @api-readonly | json |
|
||||
| `welder-qualification-table` | @api-readonly | json |
|
||||
| `welder-qualification-table2` | @api-readonly | json |
|
||||
|
||||
---
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### cURL
|
||||
|
||||
```bash
|
||||
curl -X GET \
|
||||
'{base_url}/api/endpoints/users' \
|
||||
-H 'Authorization: Bearer {your_token}' \
|
||||
-H 'Accept: application/json'
|
||||
```
|
||||
|
||||
### JavaScript
|
||||
|
||||
```javascript
|
||||
const response = await fetch('/api/endpoints/users', {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + token,
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
});
|
||||
const data = await response.json();
|
||||
```
|
||||
@@ -1,76 +0,0 @@
|
||||
# Approximate Values User Guide
|
||||
|
||||
## What is the Approximate Values Module?
|
||||
|
||||
The Approximate Values module manages approximate values and estimates for various project parameters. This module helps track estimated values, manage value ranges, and ensure proper value management for project planning and estimation.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Approximate Values:
|
||||
1. Login to the system
|
||||
2. Click on **Settings** in the main menu
|
||||
3. Select **Approximate Values** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Value Management**: Manage approximate values and estimates
|
||||
- **Range Tracking**: Track value ranges and tolerances
|
||||
- **Estimation Tools**: Provide estimation tools and calculators
|
||||
- **Documentation**: Maintain value documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate value reports
|
||||
- **Data Analysis**: Analyze value trends and patterns
|
||||
- **Export Options**: Export value data in various formats
|
||||
- **Validation Tools**: Validate value accuracy
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing Approximate Values
|
||||
1. Click **"Manage Values"** button
|
||||
2. Select value category for management
|
||||
3. Review current values and ranges
|
||||
4. Update approximate values
|
||||
5. Set value tolerances
|
||||
6. Track value changes
|
||||
7. Generate value reports
|
||||
|
||||
### Value Management
|
||||
1. Review approximate values
|
||||
2. Update value estimates
|
||||
3. Set value ranges and tolerances
|
||||
4. Track value changes
|
||||
5. Generate value reports
|
||||
|
||||
### Value Categories
|
||||
- **Cost Values**: Cost estimates and ranges
|
||||
- **Time Values**: Time estimates and durations
|
||||
- **Quantity Values**: Quantity estimates and amounts
|
||||
- **Quality Values**: Quality parameters and standards
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Keep values current and accurate
|
||||
- ✅ Set appropriate value ranges
|
||||
- ✅ Track value changes regularly
|
||||
- ✅ Maintain proper documentation
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify value accuracy and completeness
|
||||
- ✅ Ensure proper value ranges
|
||||
- ✅ Monitor value management effectiveness
|
||||
- ✅ Regular review of value processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Values not saving**: Check all required fields are completed
|
||||
2. **Range errors**: Verify value ranges and tolerances
|
||||
3. **Calculation problems**: Check calculation formulas and parameters
|
||||
|
||||
### Getting Help
|
||||
- Contact the Settings department for technical support
|
||||
- Consult approximate values procedures and guidelines
|
||||
- Check value data and calculation parameters
|
||||
@@ -1,75 +0,0 @@
|
||||
# Weldmap Fast User Guide
|
||||
|
||||
## What is the Weldmap Fast Module?
|
||||
|
||||
The Weldmap Fast module provides quick access to welding map functionality for rapid weld tracking and management. This module offers streamlined weld mapping features for efficient project management and quick weld status updates.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Weldmap Fast:
|
||||
1. Login to the system
|
||||
2. Click on **Manufacturing** in the main menu
|
||||
3. Select **Weldmap Fast** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Quick Weld Mapping**: Rapid weld mapping and tracking
|
||||
- **Fast Status Updates**: Quick status updates for welds
|
||||
- **Streamlined Interface**: Simplified interface for efficiency
|
||||
- **Rapid Data Entry**: Fast data entry and updates
|
||||
|
||||
### Secondary Functions
|
||||
- **Quick Search**: Fast search and filtering capabilities
|
||||
- **Rapid Reports**: Quick report generation
|
||||
- **Fast Navigation**: Rapid navigation between welds
|
||||
- **Quick Export**: Fast data export functionality
|
||||
|
||||
## How to Use
|
||||
|
||||
### Using Weldmap Fast
|
||||
1. Access Weldmap Fast module
|
||||
2. Use quick search to find welds
|
||||
3. Update weld status rapidly
|
||||
4. Enter data quickly and efficiently
|
||||
5. Generate quick reports
|
||||
6. Export data as needed
|
||||
|
||||
### Fast Operations
|
||||
1. Search for specific welds quickly
|
||||
2. Update weld status and information
|
||||
3. Navigate between weld records rapidly
|
||||
4. Generate quick status reports
|
||||
5. Export data for analysis
|
||||
|
||||
### Fast Categories
|
||||
- **Quick Updates**: Rapid status updates
|
||||
- **Fast Search**: Quick search functionality
|
||||
- **Rapid Reports**: Fast report generation
|
||||
- **Quick Export**: Fast data export
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Use quick search for efficient navigation
|
||||
- ✅ Update weld status promptly
|
||||
- ✅ Use fast features for routine operations
|
||||
- ✅ Generate quick reports as needed
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify data accuracy in fast operations
|
||||
- ✅ Ensure proper weld status updates
|
||||
- ✅ Monitor fast operation effectiveness
|
||||
- ✅ Regular review of fast processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Fast search not working**: Check search criteria and data availability
|
||||
2. **Quick update fails**: Verify weld data and permissions
|
||||
3. **Fast report errors**: Check report configuration and data
|
||||
|
||||
### Getting Help
|
||||
- Contact the Manufacturing department for technical support
|
||||
- Consult Weldmap Fast procedures and guidelines
|
||||
- Check weld data and system status
|
||||
@@ -1,204 +0,0 @@
|
||||
# Joint Release Log — Batch Excel Bugfix Raporu
|
||||
|
||||
**Tarih:** 2026-03-27
|
||||
**Branch:** `bugfix/spool-release-web-27032026`
|
||||
|
||||
---
|
||||
|
||||
## Yapılan Değişiklikler
|
||||
|
||||
### 1. `batch-excel.blade.php` — Memory Limit Fix
|
||||
|
||||
**Sorun:** `weld_logs` tablosu seçilince PHP 128MB memory limiti aşılıyordu.
|
||||
|
||||
**Neden:** Grid başlangıç datasını PHP döngüsüyle üretiyordu — 10.000 satır × N kolon = PHP'de milyonlarca string ifadesi render ediliyordu.
|
||||
|
||||
```php
|
||||
// ESKİ — PHP'de üretim
|
||||
for($row=1;$row<=$rowSize;$row++) {
|
||||
for($cell=1;$cell<=count($columns);$cell++) { echo "''," }
|
||||
}
|
||||
|
||||
// YENİ — JS'de üretim
|
||||
var emptyRow = new Array({{ count($columns) }}).fill('');
|
||||
var emptyData = [];
|
||||
for (var i = 0; i < {{ $rowSize }}; i++) emptyData.push(emptyRow.slice());
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 2. `batch-excel-save.blade.php` — Yanlış Tabloya Insert Engeli
|
||||
|
||||
**Sorun:** `joint-release-log` modülüyle açılan saved state linki `module` parametresini taşımıyordu. `module` boş gelince `joint-release-log` bloğu atlanıyordu, normal weld_logs insert akışına giriyordu → **6595 sahte kayıt eklendi.**
|
||||
|
||||
**Düzeltmeler:**
|
||||
|
||||
a) `weld_logs`'a batch excel üzerinden insert tamamen engellendi:
|
||||
```php
|
||||
if($tableName == "weld_logs") {
|
||||
$errorRows[] = ['error' => "Insert into weld_logs is not allowed via batch excel."];
|
||||
continue;
|
||||
}
|
||||
```
|
||||
|
||||
b) `welding_date` zorunluluğu kaldırıldı (listedeki tarih sütunu `welding_date` değil `rfi_date`'di):
|
||||
```php
|
||||
// ESKİ — 3 alan zorunlu
|
||||
if (!isset($row['iso_number']) || !isset($row['no_of_the_joint_as_per_as_built_survey']) || !isset($refactoringRow['welding_date']))
|
||||
|
||||
// YENİ — 2 alan yeterli
|
||||
if (!isset($row['iso_number']) || !isset($row['no_of_the_joint_as_per_as_built_survey']))
|
||||
```
|
||||
|
||||
c) `welding_date` where koşulundan kaldırıldı — `iso_number + joint_no` ile eşleştirme yeterli:
|
||||
```php
|
||||
$whereData = [
|
||||
'no_of_the_joint_as_per_as_built_survey' => $row['no_of_the_joint_as_per_as_built_survey'],
|
||||
'iso_number' => $row['iso_number'],
|
||||
];
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 3. `batch-excel.blade.php` — Saved State'e `module` Kaydedilmesi
|
||||
|
||||
**Sorun:** Save-link AJAX'ı `module` parametresini POST etmiyordu, saved state linki de URL'e `module` eklemiyordu.
|
||||
|
||||
**Çözüm:** `contents.html` kolonu `module` bilgisini tutmak için kullanıldı.
|
||||
|
||||
```php
|
||||
// Kaydetme
|
||||
'html' => post("module")
|
||||
|
||||
// Link oluşturma
|
||||
{{ $link->html ? '&module='.urlencode($link->html) : '' }}
|
||||
|
||||
// AJAX POST
|
||||
module: '{{get("module")}}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 4. `weldmap/main.blade.php` — Joint Releases JOIN
|
||||
|
||||
**Sorun:** Joint-release-log sayfası release alanlarını `weld_logs` tablosundan okuyordu. Migration'da `weld_logs`'taki release kolonları drop edilmemişti, `joint_releases` tablosuna JOIN yapılmamıştı.
|
||||
|
||||
**Çözüm:** Her iki query'ye LEFT JOIN eklendi, release alanları `jr.*` / `jr2.*` prefix'i ile okunuyor:
|
||||
```php
|
||||
->leftJoin('joint_releases as jr', 'weld_logs.id', '=', 'jr.weld_log_id')
|
||||
->leftJoin('joint_releases as jr2', 'deleted_joints.id', '=', 'jr2.deleted_joint_id')
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 5. `weldlog.blade.php` — E1047 DevExtreme Hatası
|
||||
|
||||
**Sorun:** `joint_releases` tablosu oluşturulurken `weld_logs`'taki `*_release_*` kolonları drop edilmemişti. `table_columns()` bunları döndürüyordu → datagrid columns array'ine giriyordu → `blockGroup`'ta tanımlı olmadığı için DevExtreme **E1047** hatası veriyordu → weldlog sayfası açılmıyordu.
|
||||
|
||||
**İlk uygulanan çözüm (YANLIŞ):** `weldlog.blade.php`'ye `Joint Release` grubu eklendi, 22 release kolonu `blockGroup`'a dahil edildi.
|
||||
|
||||
**Neden yanlıştı:** `dev` branch'inde weldlog sorunsuz çalışıyor çünkü `module-block.blade.php`'de `$blockGroup` tanımlıysa `table_columns()` hiç çağrılmıyor — `$columns` doğrudan `$blockGroup`'tan üretiliyor. Release kolonları `blockGroup`'ta olmadığı için datagrid'e zaten girmiyor. `weld_logs`'ta fiziksel kolon varlığı `blockGroup` mekanizması sayesinde sorun yaratmıyor.
|
||||
|
||||
```php
|
||||
// module-block.blade.php
|
||||
if(!isset($columns)) {
|
||||
if(isset($blockGroupColumns)) {
|
||||
$columns = $blockGroupColumns; // blockGroup varsa table_columns() çağrılmaz
|
||||
} else {
|
||||
$columns = table_columns($tableName);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Gerçek sorun:** E1047 hatası weldlog'tan değil, `main.blade.php`'ye eklediğimiz gereksiz JOIN kodundan kaynaklanıyordu. `main.blade.php`'deki `$weldLogsSelectColumns` bloğu `$columns` listesinde olmayan release kolonlarını `jr.*` prefix'iyle SELECT'e ekliyordu — bu kolonlar datagrid'e girince `blockGroup`'ta tanımlı olmadığı için E1047 patladı.
|
||||
|
||||
**Doğru çözüm:** `weldlog.blade.php`'ye eklenen `Joint Release` bloğu **geri alındı**. `main.blade.php`'deki JOIN kodu dev'de zaten `joint_release_view` DB view'ı üzerinden çözülmüş — bizim eklediğimiz JOIN gereksizdi.
|
||||
|
||||
---
|
||||
|
||||
### 6. MAMP FastCGI Timeout
|
||||
|
||||
**Sorun:** `set_time_limit(-1)` FastCGI modunda etkisiz. 30 saniyelik default timeout büyük batch işlemlerini kesiyordu.
|
||||
|
||||
**Çözüm:** `/Applications/MAMP/conf/apache/httpd.conf`:
|
||||
```
|
||||
FastCgiServer /Applications/MAMP/fcgi-bin/php.fcgi -socket httpdFastCGI.sock -idle-timeout 300
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 7. Veri Temizliği (DB)
|
||||
|
||||
| İşlem | Miktar | Açıklama |
|
||||
|---|---|---|
|
||||
| DELETE | 6.595 kayıt | ID 90000–96594, created_at=null, tüm alanlar null |
|
||||
| UPDATE | 639 kayıt | `general_contractor` alanındaki tarih değerleri → null |
|
||||
|
||||
---
|
||||
|
||||
## Alternatif / Daha Basit Çözümler
|
||||
|
||||
### E1047 Hatası İçin
|
||||
|
||||
**Gerçek sorun kaynağı:** `main.blade.php`'ye eklenen gereksiz JOIN kodu. `dev` branch'inde bu iş `joint_release_view` DB view'ı üzerinden çözülmüş, manuel JOIN'e gerek yoktu.
|
||||
|
||||
**Daha basit yol — `main.blade.php`'ye dokunmamak:**
|
||||
`dev` branch'inden farkı incelemeden kod eklemek, çakışma yarattı. Branch farkı önce `git diff dev` ile incelenmeliydi.
|
||||
|
||||
**Eğer gerçekten migration'da kök çözüm istenseydi:**
|
||||
```php
|
||||
// create_joint_releases_table migration'ına eklenmeliydi:
|
||||
foreach(['joint_release_rfi_no','joint_release_rfi_date',...] as $col) {
|
||||
Schema::table('weld_logs', fn($t) => $t->dropColumnIfExists($col));
|
||||
}
|
||||
```
|
||||
Ama `joint_release_view` view'ı `weld_logs`'taki kolonlara göre dinamik oluşturuluyor — drop edilseydi view da bozulurdu. Bu nedenle kolonların fiziksel olarak tutulması kasıtlı bir tasarım kararıydı.
|
||||
|
||||
### `weld_logs` Insert Engeli İçin
|
||||
|
||||
**Yapılan:** Sunucu tarafında hard block — hata mesajıyla return.
|
||||
|
||||
**Daha kullanıcı dostu yol:** `batch-excel.blade.php`'de `weld_logs` tablosu seçilince "Store Data" butonu gizlenmesi ya da disabled yapılması. Kullanıcı göndermeden önce uyarılırdı.
|
||||
|
||||
### Saved State `module` Sorunu İçin
|
||||
|
||||
**Yapılan:** `contents.html` kolonuna module bilgisi yazıldı — mevcut tabloyu şişirmeden çalışıyor.
|
||||
|
||||
**Daha temiz yol:** `contents` tablosuna `module` adında dedicated bir kolon eklemek. `html` kolonu semantik olarak başka amaçlar için kullanılabilir, `module` bilgisini tutmak için doğru alan değil.
|
||||
|
||||
---
|
||||
|
||||
## Öğrenilen Dersler
|
||||
|
||||
1. **Branch farkını önce incele.** `dev`'de çalışıyorsa neden çalıştığını anlamadan aynı problemi farklı yolla çözmeye çalışmak ikincil hatalar yaratır. `git diff dev -- <dosya>` ile önce fark görülmeliydi.
|
||||
2. **`blockGroup` mekanizmasını anla.** `module-block.blade.php`'de `blockGroup` tanımlıysa `table_columns()` hiç çağrılmaz — kolonlar sadece `blockGroup`'tan gelir. Bu mekanizma bilinmeden yapılan müdahale E1047'ye yol açtı.
|
||||
3. **Saved state sistemleri** tüm URL parametrelerini (module dahil) saklamalı.
|
||||
4. **FastCGI ortamında** `set_time_limit()` çalışmaz — timeout Apache config'den yönetilmeli.
|
||||
5. **Batch işlemlerde** insert/update ayrımı net olmalı, kritik tablolar için insert tamamen kısıtlanmalı.
|
||||
6. **`weld_logs`'taki release kolonları kasıtlı bırakılmış** — `joint_release_view` view'ı bu kolonlara göre dinamik oluşturuluyor, drop etmek view'ı bozar.
|
||||
7. **DevExtreme stateStoring'de `filterValue` ≠ `filter`.** `filterPanel` state'i `filterValue` key'i ile saklanır, `filter` ile değil. `customLoad` içinde yanlış key temizlenince stale filtre kalır ve E1047 fırlar.
|
||||
8. **Geçici yanlış fix bile iz bırakır.** Yanlış blockGroup anlık eklendi-geri alındı, ama kullanıcı o sürede `joint_release_rfi_date` kolonuna filtre koydu — bu filtre localStorage'da kaldı ve sonraki her açılışta E1047 patlattı.
|
||||
|
||||
---
|
||||
|
||||
## Değişiklik Özeti (git diff)
|
||||
|
||||
### Gerekli Değişiklikler
|
||||
|
||||
| Dosya | Değişiklik | Neden |
|
||||
|---|---|---|
|
||||
| `batch-excel.blade.php` | PHP döngüsü → JS `Array.fill()` ile boş data üretimi | PHP 128MB memory limit aşımı |
|
||||
| `batch-excel.blade.php` | Save-link AJAX'ına `module` eklendi; saved state URL'ine `module` parametresi eklendi | Saved state linki joint-release-log modülünü kaybediyordu |
|
||||
| `batch-excel-save.blade.php` | `joint-release-log` için `welding_date` zorunluluğu kaldırıldı; WHERE'den çıkarıldı | Excel listesindeki tarih kolonu `rfi_date`, `welding_date` değil |
|
||||
| `batch-excel-save.blade.php` | `weld_logs`'a insert hard block eklendi; dead code (ulaşılamaz duplicate kontrol) silindi | 6595 sahte kayıt olayının tekrar yaşanmaması |
|
||||
| `batch-excel-save.blade.php` | `weld_logs` update sırasında release alanlarını `joint_releases`'e sync et | Batch excel'den release alanı güncellenince `joint_releases` tablosu güncellenmiyordu |
|
||||
| `main.blade.php` | `joint-release-log` bloğuna `joint_releases` LEFT JOIN eklendi; release alanları `jr.*`/`jr2.*` prefix'i ile okunuyor | Release alanları `weld_logs`'tan değil `joint_releases` tablosundan okunmalı |
|
||||
| `js-state-storing.blade.php` | `wps_joint_type_ru` tek alan yerine tüm stale release alanları temizleniyor; `filter` yerine `filterValue` key'i temizleniyor | `filterPanel` state'i `filterValue` key'i kullanıyor, `filter` değil |
|
||||
| `js-helpers.blade.php` | weldlog localStorage temizleme bloğu `filterValue`'ya bakacak şekilde güncellendi; stale alan listesi genişletildi | Aynı `filterValue` vs `filter` hatası |
|
||||
|
||||
### Dokunulmayan Dosyalar
|
||||
|
||||
| Dosya | Neden |
|
||||
|---|---|
|
||||
| `weldlog.blade.php` | Yanlış `Joint Release` blockGroup eklendi → geri alındı. Şu an dev ile identik. |
|
||||
| `mobile/*` (Podfile.lock, pubspec.lock, vb.) | `share_plus` paketi eklenmesinden kaynaklanan otomatik değişiklikler — bu bugfix ile ilgisi yok. |
|
||||
@@ -1,211 +0,0 @@
|
||||
# Batch Excel Save Documentation
|
||||
|
||||
## Overview
|
||||
|
||||
The batch Excel save functionality allows users to import large amounts of data from Excel files into the database. This system processes Excel data row by row, handles different data types, manages permissions, and provides detailed feedback about the import process.
|
||||
|
||||
## How It Works
|
||||
|
||||
### 1. Initial Setup
|
||||
|
||||
The system starts by setting up the environment for handling large files:
|
||||
|
||||
- **Time Limits**: Removes time restrictions to handle large files
|
||||
- **File Size**: Increases upload limits to 2GB
|
||||
- **Memory**: Allocates 8GB of memory for processing
|
||||
- **Execution Time**: Allows unlimited processing time
|
||||
|
||||
### 2. Data Type Detection
|
||||
|
||||
Before processing, the system automatically detects what type of data each column contains:
|
||||
|
||||
- **Numeric Columns**: Identifies columns that should contain numbers (integers, decimals, etc.)
|
||||
- **Date Columns**: Recognizes date fields and special date columns
|
||||
- **Text Columns**: Handles regular text data
|
||||
|
||||
### 3. Permission Checking
|
||||
|
||||
The system checks user permissions before processing:
|
||||
|
||||
- **Delete Permission**: Can the user delete records?
|
||||
- **Modify Permission**: Can the user update existing records?
|
||||
- **Write Permission**: Can the user create new records?
|
||||
- **Full Control**: Can the user do all operations?
|
||||
|
||||
### 4. Data Processing
|
||||
|
||||
For each row in the Excel file, the system:
|
||||
|
||||
#### Step 1: Data Validation
|
||||
- Checks if the row data is properly formatted
|
||||
- Validates that all required columns are present
|
||||
- Ensures data structure is correct
|
||||
|
||||
#### Step 2: Data Cleaning
|
||||
- Removes extra spaces from text
|
||||
- Converts empty cells to null values
|
||||
- Handles special values like "NULL*" (converts to null)
|
||||
|
||||
#### Step 3: Data Type Conversion
|
||||
|
||||
**For Numbers:**
|
||||
- Converts Turkish number format (1.234,56) to standard format (1234.56)
|
||||
- Handles negative numbers properly
|
||||
- Removes thousand separators
|
||||
- Validates numeric values
|
||||
|
||||
**For Dates:**
|
||||
- Converts various date formats to standard Y-m-d format
|
||||
- Handles different separators (/, .)
|
||||
- Uses Carbon library for date parsing
|
||||
- Validates date values
|
||||
|
||||
**For Text:**
|
||||
- Trims whitespace
|
||||
- Handles empty values
|
||||
|
||||
### 5. Record Processing Logic
|
||||
|
||||
The system uses different strategies based on the table type:
|
||||
|
||||
#### Strategy 1: ISO Number + Joint Number (for weld logs)
|
||||
- Looks for existing records using ISO number and joint number
|
||||
- Updates existing records or creates new ones
|
||||
- Prevents duplicate entries
|
||||
|
||||
#### Strategy 2: Spool Number + ISO Number
|
||||
- Uses spool number and ISO number to find existing records
|
||||
- Updates or creates records accordingly
|
||||
|
||||
#### Strategy 3: Line Number + Fluid Code (for line lists)
|
||||
- Matches records using line number and fluid code
|
||||
- Updates existing or creates new records
|
||||
|
||||
#### Strategy 4: Test Package Number (for test packages)
|
||||
- Uses test package number as the unique identifier
|
||||
- Updates existing or creates new records
|
||||
|
||||
#### Strategy 5: ID-based Processing (default)
|
||||
- Uses the ID field to determine if record exists
|
||||
- Updates existing records or creates new ones
|
||||
|
||||
### 6. Duplicate Prevention
|
||||
|
||||
For weld logs specifically, the system:
|
||||
- Checks for duplicate ISO number + joint number combinations
|
||||
- Prevents creation of duplicate entries
|
||||
- Reports duplicate errors to the user
|
||||
|
||||
### 7. Memory Management
|
||||
|
||||
To handle large files efficiently:
|
||||
- Processes data in batches of 1000 rows
|
||||
- Commits database transactions every 1000 rows
|
||||
- Cleans up memory every 500 rows
|
||||
- Uses garbage collection to free memory
|
||||
|
||||
### 8. Error Handling
|
||||
|
||||
The system tracks different types of issues:
|
||||
|
||||
- **Processing Errors**: Problems with data format or validation
|
||||
- **Permission Errors**: User doesn't have required permissions
|
||||
- **Duplicate Errors**: Attempted to create duplicate records
|
||||
- **Database Errors**: Problems with database operations
|
||||
|
||||
### 9. Change Tracking
|
||||
|
||||
For each record processed, the system:
|
||||
- Records which columns were changed
|
||||
- Creates audit trail entries
|
||||
- Tracks who made the changes
|
||||
- Records the IP address of the user
|
||||
|
||||
### 10. Trigger Execution
|
||||
|
||||
After processing all data, the system can run triggers:
|
||||
- Updates related tables
|
||||
- Runs business logic
|
||||
- Executes custom scripts for specific tables
|
||||
|
||||
## Response Format
|
||||
|
||||
The system returns detailed information about the import process:
|
||||
|
||||
```json
|
||||
{
|
||||
"storedData": 1500, // Total records processed
|
||||
"update": 800, // Records updated
|
||||
"insert": 700, // Records created
|
||||
"delete": 0, // Records deleted
|
||||
"error": null, // Any system errors
|
||||
"insertedRowNumbers": [1,2,3], // Excel row numbers for new records
|
||||
"updatedRowNumbers": [4,5,6], // Excel row numbers for updated records
|
||||
"errorRows": [], // Rows with errors
|
||||
"totalErrors": 0 // Total number of errors
|
||||
}
|
||||
```
|
||||
|
||||
## Special Features
|
||||
|
||||
### 1. Row Number Tracking
|
||||
- Tracks which Excel row numbers were processed
|
||||
- Reports which rows were inserted, updated, or had errors
|
||||
- Helps users identify problems in their Excel files
|
||||
|
||||
### 2. Batch Processing
|
||||
- Processes large files without memory issues
|
||||
- Commits data in chunks to prevent data loss
|
||||
- Provides progress feedback
|
||||
|
||||
### 3. Data Validation
|
||||
- Validates data types before processing
|
||||
- Converts formats automatically
|
||||
- Reports invalid data clearly
|
||||
|
||||
### 4. Audit Trail
|
||||
- Records all changes made
|
||||
- Tracks who made changes
|
||||
- Maintains history of modifications
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Import
|
||||
1. User uploads Excel file
|
||||
2. System detects data types automatically
|
||||
3. Processes each row according to table rules
|
||||
4. Returns detailed results
|
||||
|
||||
### Error Handling
|
||||
1. System encounters invalid data
|
||||
2. Records error with row number
|
||||
3. Continues processing other rows
|
||||
4. Reports all errors at the end
|
||||
|
||||
### Large File Processing
|
||||
1. System processes 1000 rows at a time
|
||||
2. Commits data to database
|
||||
3. Cleans up memory
|
||||
4. Continues with next batch
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Prepare Your Data**: Ensure Excel columns match database fields
|
||||
2. **Check Permissions**: Make sure you have required access rights
|
||||
3. **Validate Data**: Check for obvious errors before importing
|
||||
4. **Use Correct Format**: Follow the expected data formats
|
||||
5. **Monitor Results**: Review the response for any errors
|
||||
|
||||
## Common Issues and Solutions
|
||||
|
||||
### Issue: "Invalid data structure"
|
||||
**Solution**: Ensure Excel file has correct column headers and data format
|
||||
|
||||
### Issue: "Permission denied"
|
||||
**Solution**: Contact administrator to get required permissions
|
||||
|
||||
### Issue: "Duplicate entry"
|
||||
**Solution**: Check for duplicate records in your Excel file
|
||||
|
||||
### Issue: "Memory limit exceeded"
|
||||
**Solution**: Process smaller batches or contact administrator to increase limits
|
||||
@@ -1,78 +0,0 @@
|
||||
# Batch Excel User Guide
|
||||
|
||||
## What is the Batch Excel Module?
|
||||
|
||||
The Batch Excel module provides batch processing capabilities for Excel file operations. This module allows users to perform bulk operations on Excel files, including import, export, data processing, and file management tasks.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Batch Excel:
|
||||
1. Login to the system
|
||||
2. Click on **Settings** in the main menu
|
||||
3. Select **Batch Excel** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Batch Import**: Import multiple Excel files simultaneously
|
||||
- **Batch Export**: Export data to multiple Excel files
|
||||
- **Data Processing**: Process large datasets in batches
|
||||
- **File Management**: Organize and manage Excel files
|
||||
|
||||
### Secondary Functions
|
||||
- **Template Management**: Use and manage Excel templates
|
||||
- **Data Validation**: Validate data before processing
|
||||
- **Error Handling**: Handle and report processing errors
|
||||
- **Progress Tracking**: Monitor batch processing progress
|
||||
|
||||
## How to Use
|
||||
|
||||
### Batch Import Process
|
||||
1. Click **"Batch Import"** button
|
||||
2. Select multiple Excel files to import
|
||||
3. Choose the target data tables
|
||||
4. Configure import settings and mappings
|
||||
5. Review the import preview
|
||||
6. Click **"Start Import"**
|
||||
7. Monitor progress and handle any errors
|
||||
|
||||
### Batch Export Process
|
||||
1. Click **"Batch Export"** button
|
||||
2. Select the data sources to export
|
||||
3. Choose export format and settings
|
||||
4. Set file naming conventions
|
||||
5. Configure export templates
|
||||
6. Click **"Start Export"**
|
||||
7. Download the generated files
|
||||
|
||||
### Supported Operations
|
||||
- **Data Import**: Import data from Excel to database tables
|
||||
- **Data Export**: Export data from database to Excel files
|
||||
- **File Conversion**: Convert between different Excel formats
|
||||
- **Data Transformation**: Transform data during import/export
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Always backup data before batch operations
|
||||
- ✅ Test batch operations on small datasets first
|
||||
- ✅ Verify file formats and data structure
|
||||
- ✅ Monitor system resources during large operations
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Validate data before and after processing
|
||||
- ✅ Check for duplicate records during import
|
||||
- ✅ Verify file integrity after export
|
||||
- ✅ Review error logs for any issues
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Import fails**: Check file format and data structure
|
||||
2. **Export incomplete**: Verify data source and permissions
|
||||
3. **System slow**: Reduce batch size or schedule during off-peak hours
|
||||
|
||||
### Getting Help
|
||||
- Contact the IT department for technical support
|
||||
- Check the batch processing logs for error details
|
||||
- Consult the data management team for complex operations
|
||||
@@ -1,114 +0,0 @@
|
||||
# Blade Caching System Implementation Guide
|
||||
|
||||
This guide provides a step-by-step explanation of how to implement the Blade View Caching system in DevQMS. This system is designed to improve performance for heavy pages (like complex dashboards, large reports, or data grids) by serving pre-rendered HTML from storage instead of processing PHP/Database queries on every request.
|
||||
|
||||
## Table of Contents
|
||||
1. [System Overview](#system-overview)
|
||||
2. [Related Files](#related-files)
|
||||
3. [Implementation Steps](#implementation-steps)
|
||||
- [Step 1: Isolate Heavy Logic (No-Cache View)](#step-1-isolate-heavy-logic-no-cache-view)
|
||||
- [Step 2: Create the Loader View](#step-2-create-the-loader-view)
|
||||
- [Step 3: Trigger Cache Updates](#step-3-trigger-cache-updates)
|
||||
4. [Adding to Default Updates](#adding-to-default-updates)
|
||||
|
||||
---
|
||||
|
||||
## System Overview
|
||||
|
||||
The caching mechanism splits a standard Blade view into two parts:
|
||||
1. **Source View (`*-no-cache.blade.php`):** Contains the actual code, queries, and heavy logic. This file is rarely accessed directly by the user.
|
||||
2. **Loader View (`*.blade.php`):** A lightweight file that simply reads the rendered output of the Source View from the file storage.
|
||||
|
||||
When data changes in the system, a background job renders the Source View and saves the HTML to the storage folder. The Loader View then serves this static HTML instantly.
|
||||
|
||||
## Related Files
|
||||
|
||||
- **`app/Functions/cache-blade-load.php`**: Contains the `cacheBladeLoad($cacheName)` function used in Loader Views to read from storage.
|
||||
- **`app/Functions/cache-blade-views.php`**: Contains the `dispatchCacheBladeViews($views)` function used to trigger cache regeneration.
|
||||
- **`app/Jobs/CacheBladeViewJob.php`**: The background job that performs the actual rendering and saving.
|
||||
|
||||
---
|
||||
|
||||
## Implementation Steps
|
||||
|
||||
Let's assume you have a heavy report file at: `resources/views/reports/monthly-summary.blade.php`.
|
||||
|
||||
### Step 1: Isolate Heavy Logic (No-Cache View)
|
||||
|
||||
Rename your existing heavy file by appending `-no-cache` to the filename.
|
||||
|
||||
* **Old Path:** `resources/views/reports/monthly-summary.blade.php`
|
||||
* **New Path:** `resources/views/reports/monthly-summary-no-cache.blade.php`
|
||||
|
||||
This file keeps all your original logic, loops, and database calls.
|
||||
|
||||
### Step 2: Create the Loader View
|
||||
|
||||
Create a new file with the original filename (`monthly-summary.blade.php`). This file will act as a proxy.
|
||||
|
||||
**File:** `resources/views/reports/monthly-summary.blade.php`
|
||||
|
||||
```php
|
||||
@php
|
||||
// Define a unique cache key for this view
|
||||
// Ideally, use a naming convention related to the file path
|
||||
$cacheKey = 'reports-monthly-summary';
|
||||
@endphp
|
||||
|
||||
{{-- Load the cached content --}}
|
||||
{{ cacheBladeLoad($cacheKey) }}
|
||||
```
|
||||
|
||||
Now, when a user visits the page, they will see the content from the cache.
|
||||
|
||||
### Step 3: Trigger Cache Updates
|
||||
|
||||
Since the Loader View reads static files, it won't show new data automatically. You must trigger a cache refresh when data changes (e.g., after an Excel import, a form submission, or a status change).
|
||||
|
||||
Use the `dispatchCacheBladeViews` helper in your Controller or Service:
|
||||
|
||||
```php
|
||||
// In your Controller
|
||||
public function updateReportData(Request $request)
|
||||
{
|
||||
// 1. Perform the data update
|
||||
// ... code to update database ...
|
||||
|
||||
// 2. Refresh the cache for the report
|
||||
dispatchCacheBladeViews([
|
||||
[
|
||||
'view' => 'reports.monthly-summary-no-cache', // Dot-notation path to the NO-CACHE file
|
||||
'cache' => 'reports-monthly-summary' // The cache key used in Step 2
|
||||
]
|
||||
]);
|
||||
|
||||
return redirect()->back()->with('success', 'Data updated and cache refreshing...');
|
||||
}
|
||||
```
|
||||
|
||||
The system will push a job to the queue. The job will render `reports.monthly-summary-no-cache` and save the output to `storage/app/cache/reports-monthly-summary.blade.php`.
|
||||
|
||||
---
|
||||
|
||||
## Adding to Default Updates
|
||||
|
||||
If your view is a core part of the system (like a main dashboard) and should be updated with general system events, you can add it to the default list.
|
||||
|
||||
1. Open `app/Functions/cache-blade-views.php`.
|
||||
2. Locate the `$defaultCacheViews` array.
|
||||
3. Add your view configuration:
|
||||
|
||||
```php
|
||||
$defaultCacheViews = [
|
||||
// ... existing views ...
|
||||
[
|
||||
'view' => 'reports.monthly-summary-no-cache',
|
||||
'cache' => 'reports-monthly-summary'
|
||||
],
|
||||
];
|
||||
```
|
||||
|
||||
Now, whenever any part of the code calls `dispatchCacheBladeViews()` (without arguments), your report will also be refreshed.
|
||||
|
||||
|
||||
|
||||
@@ -1,285 +0,0 @@
|
||||
# Bugfix Summary - Document Manager Permissions
|
||||
|
||||
**Date:** December 3, 2025
|
||||
**Branch:** `bugfix/document-manager-permissions-03122025`
|
||||
**Status:** ✅ COMPLETED
|
||||
|
||||
---
|
||||
|
||||
## Issues Identified
|
||||
|
||||
### 1. Critical Performance Issue ⚠️
|
||||
- **Problem:** Document Manager was extremely slow for non-admin users
|
||||
- **Root Cause:** No caching mechanism for permission checks
|
||||
- **Impact:**
|
||||
- 50 files = 350 database queries
|
||||
- Load time: 82.77ms
|
||||
- 1000 files would take ~1.66 seconds
|
||||
|
||||
### 2. Undefined Variable Bug 🐛
|
||||
- **Problem:** `$folderName` was used before being defined
|
||||
- **Location:** `CustomElfinderController.php:58`
|
||||
- **Impact:** Fatal error for non-admin users
|
||||
|
||||
---
|
||||
|
||||
## Fixes Implemented
|
||||
|
||||
### Fix #1: Cache Integration (Performance)
|
||||
|
||||
**File:** `app/Http/Controllers/CustomElfinderController.php`
|
||||
|
||||
**Changes:**
|
||||
- Replaced direct database queries with cached methods
|
||||
- `DocumentManagerPermission::hasPermission()` now used instead of raw queries
|
||||
|
||||
**Before:**
|
||||
```php
|
||||
$explicitPermission = DocumentManagerPermission::where('user_level', $user->level)
|
||||
->where('folder_path', $folderName)
|
||||
->where('permission_type', 'write')
|
||||
->first(); // ❌ No cache
|
||||
```
|
||||
|
||||
**After:**
|
||||
```php
|
||||
$hasPermission = DocumentManagerPermission::hasPermission(
|
||||
$user->level,
|
||||
$folderName,
|
||||
'write'
|
||||
); // ✅ Uses Laravel cache (1 hour TTL)
|
||||
```
|
||||
|
||||
**Impact:**
|
||||
- Query reduction: 350 → 50 queries (for 50 files)
|
||||
- Speed improvement: 82.77ms → 12.54ms (85% faster)
|
||||
|
||||
---
|
||||
|
||||
### Fix #2: Session Cache for isAuth()
|
||||
|
||||
**File:** `app/Functions/user-permissions.php`
|
||||
|
||||
**Changes:**
|
||||
- Added session-based caching to `isAuth()` function
|
||||
- Results cached per request to avoid repeated DB queries
|
||||
|
||||
**Before:**
|
||||
```php
|
||||
function isAuth($moduleType, $permissionType="read") {
|
||||
// ... query DB every time ...
|
||||
$singlePermission = db("types")->where(...)->first(); // ❌
|
||||
}
|
||||
```
|
||||
|
||||
**After:**
|
||||
```php
|
||||
function isAuth($moduleType, $permissionType="read") {
|
||||
$cacheKey = "isauth_{$user->id}_{$moduleType}_{$permissionType}";
|
||||
|
||||
if (session()->has($cacheKey)) {
|
||||
return session($cacheKey); // ✅ From cache
|
||||
}
|
||||
|
||||
// Query DB and cache result
|
||||
$result = // ... query ...
|
||||
session([$cacheKey => $result]);
|
||||
return $result;
|
||||
}
|
||||
```
|
||||
|
||||
**Impact:**
|
||||
- isAuth() calls: 3x per file → cached after first call
|
||||
- Additional query reduction per file
|
||||
|
||||
---
|
||||
|
||||
### Fix #3: Undefined Variable Bug
|
||||
|
||||
**File:** `app/Http/Controllers/CustomElfinderController.php`
|
||||
|
||||
**Changes:**
|
||||
- Moved `$folderName` definition before its first use
|
||||
|
||||
**Before:**
|
||||
```php
|
||||
Line 36: if ($user->level == "Admin") { ... }
|
||||
Line 58: if (self::isSystemFolder($folderName)) { // ❌ Undefined!
|
||||
Line 82: $folderName = self::getFolderNameFromPath($path);
|
||||
```
|
||||
|
||||
**After:**
|
||||
```php
|
||||
Line 36: $folderName = self::getFolderNameFromPath($path); // ✅ Define first
|
||||
Line 38: if ($user->level == "Admin") { ... }
|
||||
Line 60: if (self::isSystemFolder($folderName)) { // ✅ Now defined
|
||||
```
|
||||
|
||||
**Impact:**
|
||||
- Fixed fatal error for non-admin users
|
||||
- System folder protection now works correctly
|
||||
|
||||
---
|
||||
|
||||
## Test Results
|
||||
|
||||
### Performance Test Results
|
||||
|
||||
| Metric | Before | After | Improvement |
|
||||
|--------|--------|-------|-------------|
|
||||
| **50 files** | 82.77ms | 12.54ms | **85% faster** |
|
||||
| **DB queries (50 files)** | 350 | 50 | **86% reduction** |
|
||||
| **1000 files (estimated)** | 1655ms | ~250ms | **85% faster** |
|
||||
| **Speed improvement** | - | - | **99.96%** |
|
||||
|
||||
### Authorization Test Results
|
||||
|
||||
✅ **All tests passed:**
|
||||
|
||||
1. **Admin User (Trunçgil)**
|
||||
- All folders: ✅ ALLOWED (read/write/delete)
|
||||
- All folders: 👁️ VISIBLE
|
||||
- System folders: 👁️ VISIBLE
|
||||
|
||||
2. **Non-Admin User WITHOUT Permissions (test)**
|
||||
- All folders: ❌ DENIED
|
||||
- All folders: 🔒 HIDDEN
|
||||
- System folders: 🔒 HIDDEN
|
||||
|
||||
3. **Non-Admin User WITH Permissions (Sultan Sagol - Data logger)**
|
||||
- `005_PTO`: ✅ READ ALLOWED, ❌ WRITE DENIED, 👁️ VISIBLE
|
||||
- Other folders: ❌ DENIED, 🔒 HIDDEN
|
||||
|
||||
4. **System Folder Protection**
|
||||
- Admin: 👁️ VISIBLE (correct)
|
||||
- Non-Admin: 🔒 HIDDEN (correct)
|
||||
|
||||
### Cache Performance Test
|
||||
|
||||
```
|
||||
Access Check Times (same folder):
|
||||
1st call: 0.994ms
|
||||
2nd call: 0.5898ms (40.66% faster)
|
||||
3rd call: 0.5372ms (45.96% faster)
|
||||
```
|
||||
|
||||
✅ Cache is working as expected
|
||||
|
||||
---
|
||||
|
||||
## Files Modified
|
||||
|
||||
### Core Files
|
||||
1. `app/Http/Controllers/CustomElfinderController.php`
|
||||
- Replaced direct queries with cached methods
|
||||
- Fixed `$folderName` undefined variable bug
|
||||
- Applied to `checkFolderWritePermission()` and `checkFolderEditPermission()`
|
||||
|
||||
2. `app/Functions/user-permissions.php`
|
||||
- Added session cache to `isAuth()` function
|
||||
|
||||
### Test Files (for development)
|
||||
3. `performance-test.php` (new) - Performance analysis script
|
||||
4. `test-authorization.php` (new) - Authorization testing script
|
||||
5. `test-specific-user.php` (new) - User-specific permission tests
|
||||
6. `PERFORMANCE_ANALYSIS_REPORT.md` (new) - Detailed analysis report
|
||||
|
||||
---
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
❌ **None** - All changes are backward compatible
|
||||
|
||||
---
|
||||
|
||||
## Known Limitations
|
||||
|
||||
1. **Cache TTL:** Laravel cache uses 3600 seconds (1 hour) TTL
|
||||
- Permission changes may take up to 1 hour to reflect
|
||||
- Can be cleared manually with `php artisan cache:clear`
|
||||
|
||||
2. **Session Cache:** isAuth() cache is per-session
|
||||
- Cleared on logout
|
||||
- May persist across page refreshes
|
||||
|
||||
---
|
||||
|
||||
## Future Improvements (Not in this PR)
|
||||
|
||||
For even better performance, consider implementing:
|
||||
|
||||
1. **Session-based Permission Cache (99%+ improvement)**
|
||||
- Store all permissions in session on login
|
||||
- Zero DB queries after login
|
||||
- Requires Observer pattern for cache invalidation
|
||||
|
||||
2. **Permission Observer**
|
||||
- Auto-clear cache when permissions change
|
||||
- No manual cache clearing needed
|
||||
|
||||
3. **Pre-load User Permissions**
|
||||
- Load all user permissions in controller constructor
|
||||
- Further reduce queries
|
||||
|
||||
---
|
||||
|
||||
## Testing Checklist
|
||||
|
||||
- [x] Performance test with 50 files
|
||||
- [x] Performance test with 1000 files (estimated)
|
||||
- [x] Admin user full access test
|
||||
- [x] Non-admin user without permissions test
|
||||
- [x] Non-admin user with read-only permissions test
|
||||
- [x] System folder protection test
|
||||
- [x] Cache performance test
|
||||
- [x] No breaking changes verified
|
||||
|
||||
---
|
||||
|
||||
## Deployment Notes
|
||||
|
||||
1. **No Migration Required** - All changes are code-only
|
||||
2. **No Config Changes** - Uses existing cache configuration
|
||||
3. **Cache Clear Recommended** - Run `php artisan cache:clear` after deployment
|
||||
4. **Test Environment First** - Verify in staging before production
|
||||
|
||||
---
|
||||
|
||||
## Commit Message
|
||||
|
||||
```
|
||||
fix(document-manager): optimize permission checks and fix undefined variable bug
|
||||
|
||||
- Add cache integration to CustomElfinderController permission methods
|
||||
- Add session cache to isAuth() function for better performance
|
||||
- Fix undefined variable $folderName causing fatal error for non-admin users
|
||||
- Improve performance by 85% (82.77ms → 12.54ms for 50 files)
|
||||
- Reduce database queries by 86% (350 → 50 queries for 50 files)
|
||||
|
||||
Fixes performance issues reported by users where non-admin accounts
|
||||
experienced significant slowdown when accessing Document Manager.
|
||||
|
||||
Test results:
|
||||
- All authorization tests passed
|
||||
- Cache working as expected (40-46% faster on subsequent calls)
|
||||
- No breaking changes
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Review Checklist
|
||||
|
||||
- [x] Code follows project standards
|
||||
- [x] All tests passing
|
||||
- [x] Performance improved significantly
|
||||
- [x] No breaking changes
|
||||
- [x] Documentation updated (this file)
|
||||
- [x] Ready for review
|
||||
|
||||
---
|
||||
|
||||
**Total Development Time:** ~2 hours
|
||||
**Files Changed:** 2 core files, 4 test files
|
||||
**Lines Changed:** ~50 lines
|
||||
**Impact:** High (performance + bug fix)
|
||||
|
||||
@@ -1,320 +0,0 @@
|
||||
# Cache Blade Views System
|
||||
|
||||
## Table of Contents / İçindekiler
|
||||
|
||||
1. [Overview / Genel Bakış](#overview--genel-bakış)
|
||||
2. [Function Description / Fonksiyon Açıklaması](#function-description--fonksiyon-açıklaması)
|
||||
3. [Usage Examples / Kullanım Örnekleri](#usage-examples--kullanım-örnekleri)
|
||||
4. [Default Cache Views / Varsayılan Cache View'lar](#default-cache-views--varsayılan-cache-viewlar)
|
||||
5. [How It Works / Nasıl Çalışır](#how-it-works--nasıl-çalışır)
|
||||
6. [Error Handling / Hata Yönetimi](#error-handling--hata-yönetimi)
|
||||
7. [Best Practices / En İyi Uygulamalar](#best-practices--en-iyi-uygulamalar)
|
||||
|
||||
---
|
||||
|
||||
## Overview / Genel Bakış
|
||||
|
||||
**English:**
|
||||
The `dispatchCacheBladeViews()` function is a helper function that dispatches `CacheBladeViewJob` for specified Blade views. This system is used to refresh cached Blade views after data updates, ensuring that users see the most up-to-date information without manual cache clearing.
|
||||
|
||||
**Türkçe:**
|
||||
`dispatchCacheBladeViews()` fonksiyonu, belirtilen Blade view'ları için `CacheBladeViewJob` dispatch eden bir yardımcı fonksiyondur. Bu sistem, veri güncellemelerinden sonra önbelleğe alınmış Blade view'larını yenilemek için kullanılır ve kullanıcıların manuel cache temizleme yapmadan en güncel bilgileri görmesini sağlar.
|
||||
|
||||
---
|
||||
|
||||
## Function Description / Fonksiyon Açıklaması
|
||||
|
||||
**English:**
|
||||
```php
|
||||
function dispatchCacheBladeViews(array $cacheViews = [])
|
||||
```
|
||||
|
||||
**Parameters / Parametreler:**
|
||||
- `$cacheViews` (array, optional): Array of cache views to dispatch
|
||||
- Format: `[['view' => 'view.path', 'cache' => 'cache-name'], ...]`
|
||||
- If provided, only these views will be dispatched (default views will be ignored)
|
||||
- If empty, default cache views will be dispatched
|
||||
|
||||
**Return Value / Dönüş Değeri:**
|
||||
- `void` - No return value
|
||||
|
||||
**Türkçe:**
|
||||
```php
|
||||
function dispatchCacheBladeViews(array $cacheViews = [])
|
||||
```
|
||||
|
||||
**Parametreler:**
|
||||
- `$cacheViews` (array, opsiyonel): Dispatch edilecek cache view'larının dizisi
|
||||
- Format: `[['view' => 'view.path', 'cache' => 'cache-name'], ...]`
|
||||
- Verilirse, sadece bu view'lar dispatch edilir (varsayılan view'lar göz ardı edilir)
|
||||
- Boş ise, varsayılan cache view'ları dispatch edilir
|
||||
|
||||
**Dönüş Değeri:**
|
||||
- `void` - Dönüş değeri yok
|
||||
|
||||
---
|
||||
|
||||
## Usage Examples / Kullanım Örnekleri
|
||||
|
||||
### Example 1: Using Default Cache Views / Varsayılan Cache View'ları Kullanma
|
||||
|
||||
**English:**
|
||||
When called without parameters, the function dispatches default cache views:
|
||||
|
||||
```php
|
||||
dispatchCacheBladeViews();
|
||||
```
|
||||
|
||||
This will dispatch jobs for:
|
||||
- `admin-ajax.spool-list-no-cache` → `spool-list`
|
||||
- `admin-ajax.spool-area-release-no-cache` → `spool-area-release`
|
||||
|
||||
**Türkçe:**
|
||||
Parametre olmadan çağrıldığında, fonksiyon varsayılan cache view'larını dispatch eder:
|
||||
|
||||
```php
|
||||
dispatchCacheBladeViews();
|
||||
```
|
||||
|
||||
Bu, şu job'ları dispatch eder:
|
||||
- `admin-ajax.spool-list-no-cache` → `spool-list`
|
||||
- `admin-ajax.spool-area-release-no-cache` → `spool-area-release`
|
||||
|
||||
### Example 2: Using Custom Cache Views / Özel Cache View'ları Kullanma
|
||||
|
||||
**English:**
|
||||
When custom cache views are provided, only those views will be dispatched (default views are ignored):
|
||||
|
||||
```php
|
||||
dispatchCacheBladeViews([
|
||||
[
|
||||
'view' => 'admin-ajax.custom-view-no-cache',
|
||||
'cache' => 'custom-cache-name'
|
||||
],
|
||||
[
|
||||
'view' => 'admin-ajax.another-view-no-cache',
|
||||
'cache' => 'another-cache-name'
|
||||
]
|
||||
]);
|
||||
```
|
||||
|
||||
**Türkçe:**
|
||||
Özel cache view'ları verildiğinde, sadece bu view'lar dispatch edilir (varsayılan view'lar göz ardı edilir):
|
||||
|
||||
```php
|
||||
dispatchCacheBladeViews([
|
||||
[
|
||||
'view' => 'admin-ajax.custom-view-no-cache',
|
||||
'cache' => 'custom-cache-name'
|
||||
],
|
||||
[
|
||||
'view' => 'admin-ajax.another-view-no-cache',
|
||||
'cache' => 'another-cache-name'
|
||||
]
|
||||
]);
|
||||
```
|
||||
|
||||
### Example 3: Real-World Usage / Gerçek Dünya Kullanımı
|
||||
|
||||
**English:**
|
||||
Common usage in rollback or update operations:
|
||||
|
||||
```php
|
||||
// After updating spool status
|
||||
spoolStatusChanger($spoolId, $newStatus);
|
||||
|
||||
// Refresh cache views
|
||||
dispatchCacheBladeViews();
|
||||
```
|
||||
|
||||
**Türkçe:**
|
||||
Rollback veya güncelleme işlemlerinde yaygın kullanım:
|
||||
|
||||
```php
|
||||
// Spool durumu güncellendikten sonra
|
||||
spoolStatusChanger($spoolId, $newStatus);
|
||||
|
||||
// Cache view'ları yenile
|
||||
dispatchCacheBladeViews();
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Default Cache Views / Varsayılan Cache View'lar
|
||||
|
||||
**English:**
|
||||
The function has two default cache views that are automatically dispatched when no custom views are provided:
|
||||
|
||||
1. **Spool List Cache:**
|
||||
- View: `admin-ajax.spool-list-no-cache`
|
||||
- Cache Name: `spool-list`
|
||||
- Purpose: Caches the spool list view for faster loading
|
||||
|
||||
2. **Spool Area Release Cache:**
|
||||
- View: `admin-ajax.spool-area-release-no-cache`
|
||||
- Cache Name: `spool-area-release`
|
||||
- Purpose: Caches the spool area release view for faster loading
|
||||
|
||||
**Türkçe:**
|
||||
Fonksiyon, özel view verilmediğinde otomatik olarak dispatch edilen iki varsayılan cache view'a sahiptir:
|
||||
|
||||
1. **Spool Listesi Cache:**
|
||||
- View: `admin-ajax.spool-list-no-cache`
|
||||
- Cache Adı: `spool-list`
|
||||
- Amaç: Spool listesi view'ını daha hızlı yükleme için cache'ler
|
||||
|
||||
2. **Spool Alan Serbest Bırakma Cache:**
|
||||
- View: `admin-ajax.spool-area-release-no-cache`
|
||||
- Cache Adı: `spool-area-release`
|
||||
- Amaç: Spool alan serbest bırakma view'ını daha hızlı yükleme için cache'ler
|
||||
|
||||
---
|
||||
|
||||
## How It Works / Nasıl Çalışır
|
||||
|
||||
**English:**
|
||||
|
||||
1. **Parameter Check:** The function checks if `$cacheViews` is empty
|
||||
- If empty → uses `$defaultCacheViews`
|
||||
- If not empty → uses only `$cacheViews` (ignores defaults)
|
||||
|
||||
2. **Duplicate Removal:** If custom views are provided, duplicates are removed based on cache name (keeps the last occurrence)
|
||||
|
||||
3. **Job Dispatch:** For each cache view, a `CacheBladeViewJob` is dispatched asynchronously
|
||||
|
||||
4. **Error Handling:** If a job dispatch fails, the error is logged but doesn't break the main operation
|
||||
|
||||
**Türkçe:**
|
||||
|
||||
1. **Parametre Kontrolü:** Fonksiyon `$cacheViews`'ın boş olup olmadığını kontrol eder
|
||||
- Boş ise → `$defaultCacheViews` kullanılır
|
||||
- Boş değilse → sadece `$cacheViews` kullanılır (varsayılanlar göz ardı edilir)
|
||||
|
||||
2. **Tekrar Kaldırma:** Özel view'lar verilirse, cache adına göre tekrarlar kaldırılır (son oluşum korunur)
|
||||
|
||||
3. **Job Dispatch:** Her cache view için, `CacheBladeViewJob` asenkron olarak dispatch edilir
|
||||
|
||||
4. **Hata Yönetimi:** Bir job dispatch'i başarısız olursa, hata loglanır ancak ana işlem bozulmaz
|
||||
|
||||
---
|
||||
|
||||
## Error Handling / Hata Yönetimi
|
||||
|
||||
**English:**
|
||||
The function uses Laravel's `Log::error()` to log any errors that occur during job dispatch:
|
||||
|
||||
```php
|
||||
try {
|
||||
CacheBladeViewJob::dispatch($cacheView['view'], $cacheView['cache']);
|
||||
} catch (\Exception $e) {
|
||||
Log::error('Failed to dispatch CacheBladeViewJob', [
|
||||
'view' => $cacheView['view'],
|
||||
'cache' => $cacheView['cache'],
|
||||
'error' => $e->getMessage()
|
||||
]);
|
||||
}
|
||||
```
|
||||
|
||||
**Key Points:**
|
||||
- Errors are logged but don't break the main operation
|
||||
- Each error includes view path, cache name, and error message
|
||||
- The function continues processing other cache views even if one fails
|
||||
|
||||
**Türkçe:**
|
||||
Fonksiyon, job dispatch sırasında oluşan hataları loglamak için Laravel'in `Log::error()` metodunu kullanır:
|
||||
|
||||
```php
|
||||
try {
|
||||
CacheBladeViewJob::dispatch($cacheView['view'], $cacheView['cache']);
|
||||
} catch (\Exception $e) {
|
||||
Log::error('Failed to dispatch CacheBladeViewJob', [
|
||||
'view' => $cacheView['view'],
|
||||
'cache' => $cacheView['cache'],
|
||||
'error' => $e->getMessage()
|
||||
]);
|
||||
}
|
||||
```
|
||||
|
||||
**Önemli Noktalar:**
|
||||
- Hatalar loglanır ancak ana işlemi bozmaz
|
||||
- Her hata, view yolu, cache adı ve hata mesajını içerir
|
||||
- Bir cache view başarısız olsa bile, fonksiyon diğer cache view'ları işlemeye devam eder
|
||||
|
||||
---
|
||||
|
||||
## Best Practices / En İyi Uygulamalar
|
||||
|
||||
### English:
|
||||
|
||||
1. **Use Default Views When Possible:**
|
||||
- If you're updating spool-related data, use `dispatchCacheBladeViews()` without parameters
|
||||
- This ensures all relevant caches are refreshed
|
||||
|
||||
2. **Use Custom Views for Specific Updates:**
|
||||
- When you only need to refresh specific caches, provide custom views
|
||||
- This reduces unnecessary job processing
|
||||
|
||||
3. **Call After Data Updates:**
|
||||
- Always call `dispatchCacheBladeViews()` after updating data that affects cached views
|
||||
- This ensures users see the latest information
|
||||
|
||||
4. **Handle Errors Gracefully:**
|
||||
- The function already handles errors internally, but monitor logs for dispatch failures
|
||||
- Consider retry mechanisms for critical cache updates
|
||||
|
||||
5. **Avoid Duplicate Cache Names:**
|
||||
- When providing custom views, ensure unique cache names
|
||||
- Duplicates are automatically removed (last one wins), but it's better to avoid them
|
||||
|
||||
### Türkçe:
|
||||
|
||||
1. **Mümkün Olduğunda Varsayılan View'ları Kullanın:**
|
||||
- Spool ile ilgili verileri güncelliyorsanız, parametresiz `dispatchCacheBladeViews()` kullanın
|
||||
- Bu, ilgili tüm cache'lerin yenilenmesini sağlar
|
||||
|
||||
2. **Belirli Güncellemeler İçin Özel View'ları Kullanın:**
|
||||
- Sadece belirli cache'leri yenilemeniz gerektiğinde, özel view'lar sağlayın
|
||||
- Bu, gereksiz job işlemeyi azaltır
|
||||
|
||||
3. **Veri Güncellemelerinden Sonra Çağırın:**
|
||||
- Cache'lenmiş view'ları etkileyen verileri güncelledikten sonra her zaman `dispatchCacheBladeViews()` çağırın
|
||||
- Bu, kullanıcıların en güncel bilgileri görmesini sağlar
|
||||
|
||||
4. **Hataları Zarif Şekilde Yönetin:**
|
||||
- Fonksiyon zaten hataları dahili olarak yönetir, ancak dispatch başarısızlıkları için logları izleyin
|
||||
- Kritik cache güncellemeleri için yeniden deneme mekanizmaları düşünün
|
||||
|
||||
5. **Tekrarlanan Cache Adlarından Kaçının:**
|
||||
- Özel view'lar sağlarken, benzersiz cache adları sağlayın
|
||||
- Tekrarlar otomatik olarak kaldırılır (son olan kazanır), ancak bunlardan kaçınmak daha iyidir
|
||||
|
||||
---
|
||||
|
||||
## Related Files / İlgili Dosyalar
|
||||
|
||||
**English:**
|
||||
- `app/Functions/cache-blade-views.php` - Main function file
|
||||
- `app/Jobs/CacheBladeViewJob.php` - Job class that handles view caching
|
||||
- `resources/views/admin-ajax/spool-list-no-cache.blade.php` - Default cache view
|
||||
- `resources/views/admin-ajax/spool-area-release-no-cache.blade.php` - Default cache view
|
||||
|
||||
**Türkçe:**
|
||||
- `app/Functions/cache-blade-views.php` - Ana fonksiyon dosyası
|
||||
- `app/Jobs/CacheBladeViewJob.php` - View cache'leme işlemini yöneten job sınıfı
|
||||
- `resources/views/admin-ajax/spool-list-no-cache.blade.php` - Varsayılan cache view
|
||||
- `resources/views/admin-ajax/spool-area-release-no-cache.blade.php` - Varsayılan cache view
|
||||
|
||||
---
|
||||
|
||||
## Summary / Özet
|
||||
|
||||
**English:**
|
||||
The `dispatchCacheBladeViews()` function is a powerful helper for managing Blade view caching in the DevQMS system. It provides a simple interface for refreshing cached views after data updates, with built-in error handling and support for both default and custom cache views.
|
||||
|
||||
**Türkçe:**
|
||||
`dispatchCacheBladeViews()` fonksiyonu, DevQMS sisteminde Blade view cache yönetimi için güçlü bir yardımcıdır. Veri güncellemelerinden sonra cache'lenmiş view'ları yenilemek için basit bir arayüz sağlar, dahili hata yönetimi ve hem varsayılan hem de özel cache view'ları için destek içerir.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
# Calculations User Guide
|
||||
|
||||
## What is the Calculations Module?
|
||||
|
||||
The Calculations module provides advanced calculation tools and formulas for various engineering and project management tasks. This module helps users perform complex calculations, generate reports, and analyze data using built-in formulas and custom calculations.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Calculations:
|
||||
1. Login to the system
|
||||
2. Click on **Settings** in the main menu
|
||||
3. Select **Calculations** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Formula Library**: Access pre-built calculation formulas
|
||||
- **Custom Calculations**: Create and save custom calculation formulas
|
||||
- **Data Analysis**: Analyze project data using statistical functions
|
||||
- **Report Generation**: Generate calculation reports and summaries
|
||||
|
||||
### Secondary Functions
|
||||
- **Unit Conversion**: Convert between different units of measurement
|
||||
- **Calculation History**: Track and review previous calculations
|
||||
- **Template Management**: Use calculation templates for common tasks
|
||||
- **Export Results**: Export calculation results to various formats
|
||||
|
||||
## How to Use
|
||||
|
||||
### Using Pre-built Formulas
|
||||
1. Select the calculation category (e.g., Welding, NDT, Material)
|
||||
2. Choose the specific formula you need
|
||||
3. Enter the required input values
|
||||
4. Click **"Calculate"**
|
||||
5. Review the results and any warnings
|
||||
6. Save or export the calculation
|
||||
|
||||
### Creating Custom Calculations
|
||||
1. Click **"New Custom Calculation"**
|
||||
2. Define the calculation name and description
|
||||
3. Write the formula using available functions
|
||||
4. Set input parameters and units
|
||||
5. Test the calculation with sample data
|
||||
6. Save the custom formula
|
||||
|
||||
### Common Calculation Categories
|
||||
- **Welding Calculations**: Heat input, preheat requirements, etc.
|
||||
- **NDT Calculations**: Coverage calculations, sensitivity settings
|
||||
- **Material Calculations**: Weight, volume, cost calculations
|
||||
- **Quality Calculations**: Statistical analysis, process capability
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Always verify input values before calculation
|
||||
- ✅ Check units of measurement for consistency
|
||||
- ✅ Review calculation results for reasonableness
|
||||
- ✅ Document any assumptions or special conditions
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Validate formulas against industry standards
|
||||
- ✅ Cross-check results with manual calculations
|
||||
- ✅ Maintain calculation history for audit purposes
|
||||
- ✅ Update formulas based on new requirements
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Calculation error**: Check input values and formula syntax
|
||||
2. **Incorrect results**: Verify units and formula logic
|
||||
3. **Formula not working**: Ensure all required inputs are provided
|
||||
|
||||
### Getting Help
|
||||
- Contact the Engineering department for technical support
|
||||
- Consult calculation standards and procedures
|
||||
- Check the formula library for similar calculations
|
||||
@@ -1,131 +0,0 @@
|
||||
## Calibration Logs Module User Guide
|
||||
|
||||
### 1. Purpose
|
||||
|
||||
The **Calibration Logs** module is used to track the calibration status of all site instruments and welding / test equipment.
|
||||
It provides:
|
||||
|
||||
- Central register of instruments (name, model, serial, quantity)
|
||||
- Calibration certificate and user guide PDFs
|
||||
- Due date monitoring with color indications
|
||||
- Notifications when calibration is due within 20 days
|
||||
- Automatic sync from **NAKS Welding Equipments** for welding machines
|
||||
|
||||
---
|
||||
|
||||
### 2. How to Access
|
||||
|
||||
1. Login to the application.
|
||||
2. From the left menu, navigate to **QA → Calibration Logs**.
|
||||
3. The page will open with a DevExtreme DataGrid listing all calibration records.
|
||||
|
||||
---
|
||||
|
||||
### 3. Column Overview
|
||||
|
||||
Key columns (left to right):
|
||||
|
||||
- **Certification Document** (`certification_document`):
|
||||
- PDF icon link to the calibration certificate.
|
||||
- Filled automatically by the PDF upload sync script.
|
||||
- **User Guide** (`user_guide`):
|
||||
- Optional PDF link for instrument user/operation manual.
|
||||
- **Instrument** (`instrument`):
|
||||
- Category selection:
|
||||
- `Civil Works Test Equipment`
|
||||
- `Piping/Mechanical Test Equipment`
|
||||
- `Instrument Test Equipment`
|
||||
- `Painting and Coating Test Equipment`
|
||||
- `Electrical Test Equipment`
|
||||
- `Welding Equipment`
|
||||
- **Item No** (`item_no`): Line/item number from the register.
|
||||
- **Name** (`equipment_name`): Instrument or equipment name.
|
||||
- **Manufacturer** (`manufacturer`), **Model No** (`model_no`), **Serial No** (`serial_no`), **Quantity** (`quantity`)
|
||||
- **Passport / Certificate No** (`passport_certificate_no`)
|
||||
- **Place of Calibration / Verification** (`place_of_calibration_verification`):
|
||||
- `Laboratory`, `In house verification`, or `In house calibration`.
|
||||
- **Calibrated By** (`calibrated_by`)
|
||||
- **Calibration Frequency (months)** (`calibration_frequency`):
|
||||
- Integer value in months.
|
||||
- **Calibration Certificate No** (`calibration_certificate_no`)
|
||||
- **Calibration Date** (`calibration_date`)
|
||||
- **Calibration Due Date** (`calibration_due_date`)
|
||||
- **Deviation Ratio** (`deviation_ratio`)
|
||||
- **Status** (`status`):
|
||||
- `In use`, `Out Of service`, `Repair`, `Calibration-Verification`
|
||||
- **Remarks** (`remarks`) and **Comments** (`comments`)
|
||||
|
||||
System fields:
|
||||
|
||||
- **source_module**, **source_id**: Link to source modules (e.g. `welding_equipment`).
|
||||
|
||||
---
|
||||
|
||||
### 4. Row Colors & Due-Date Logic
|
||||
|
||||
Rows are color-coded based on `calibration_due_date`:
|
||||
|
||||
- **Expired (red row)**: `calibration_due_date` \< today.
|
||||
- **Due Soon (yellow row)**: `calibration_due_date` is between today and today + 20 days.
|
||||
- **Normal (white row)**: More than 20 days until due date.
|
||||
|
||||
The same due date is used by the notification command:
|
||||
|
||||
- Artisan command: `php artisan notifications:check-calibration-due`
|
||||
- Notification code: `notification_calibration_due_soon`
|
||||
|
||||
---
|
||||
|
||||
### 5. PDF Upload and Sync
|
||||
|
||||
Calibration certificates are stored under:
|
||||
|
||||
- Storage path: `storage/documents/004_QA/0020_Calibration`
|
||||
|
||||
Usage:
|
||||
|
||||
1. Open **QA → Calibration Logs**.
|
||||
2. Click the **Upload** button (top of the grid).
|
||||
3. Select table **`calibration_logs`** and drop one or more PDF files.
|
||||
4. The sync script `cron/pdf-db-calibration-logs-sync.blade.php` tries to match files to rows:
|
||||
- First by `calibration_certificate_no`
|
||||
- Then by `passport_certificate_no`
|
||||
- Finally by `equipment_name`
|
||||
5. When a match is found, the `certification_document` field is updated with the PDF path and the PDF icon becomes visible in the grid.
|
||||
|
||||
> Recommendation: Name files starting with the **Calibration Certificate No** (e.g. `C-12345 ... .pdf`) to ensure reliable matching.
|
||||
|
||||
---
|
||||
|
||||
### 6. Notifications Configuration
|
||||
|
||||
The 20-day notification uses:
|
||||
|
||||
- Command: `notifications:check-calibration-due`
|
||||
- Notification code: `notification_calibration_due_soon`
|
||||
|
||||
To configure which user levels receive this notification:
|
||||
|
||||
1. Go to **Settings → Specific Permissions → Notification Settings**.
|
||||
2. Find **“Calibration Due Soon”** (`notification_calibration_due_soon`).
|
||||
3. Select the user levels (e.g. `Admin`, `Quality Staff`, `QC Manager`).
|
||||
4. Click **Update**.
|
||||
|
||||
When the command runs (via scheduler or manually), users in these levels will see **“Calibration Due Soon”** items in the notification bell.
|
||||
|
||||
---
|
||||
|
||||
### 7. NAKS Welding Equipments Sync
|
||||
|
||||
When a record is created or updated in **NAKS Welding Equipments** (`welding_equipment` table):
|
||||
|
||||
- The helper `syncCalibrationFromWeldingEquipment()` is called from `AdminController`.
|
||||
- It creates or updates a corresponding `calibration_logs` record with:
|
||||
- `instrument = "Welding Equipment"`
|
||||
- Basic identity fields (name, manufacturer, model, serial)
|
||||
- `passport_certificate_no` from `attestation`
|
||||
- `calibration_date` from `date_of_issue`
|
||||
- `calibration_due_date` from `valid_until`
|
||||
- `status` calculated from due date (`Valid`, `Due Soon`, `Expired`)
|
||||
|
||||
This ensures welding machines are automatically visible in the Calibration Logs register without manual re-entry.
|
||||
@@ -1,77 +0,0 @@
|
||||
# Color System User Guide
|
||||
|
||||
## What is the Color System Module?
|
||||
|
||||
The Color System module manages paint color specifications, standards, and applications for various projects. This module helps ensure consistency in color selection, track color usage, and maintain quality standards for painting operations.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Color System:
|
||||
1. Login to the system
|
||||
2. Click on **Paint** in the main menu
|
||||
3. Select **Color System** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Color Library**: Access comprehensive color database with specifications
|
||||
- **Color Standards**: Manage industry-standard color codes and references
|
||||
- **Color Applications**: Track color usage across different project areas
|
||||
- **Quality Control**: Ensure color consistency and compliance
|
||||
|
||||
### Secondary Functions
|
||||
- **Color Matching**: Match colors to existing specifications
|
||||
- **Inventory Management**: Track paint inventory by color
|
||||
- **Documentation**: Generate color specification documents
|
||||
- **Approval Workflow**: Manage color approval processes
|
||||
|
||||
## How to Use
|
||||
|
||||
### Adding New Colors
|
||||
1. Click **"Add New Color"** button
|
||||
2. Enter color name and code
|
||||
3. Select color family and type
|
||||
4. Input technical specifications
|
||||
5. Upload color samples or references
|
||||
6. Set approval requirements
|
||||
7. Click **"Save Color"**
|
||||
|
||||
### Color Selection Process
|
||||
1. Browse the color library by category
|
||||
2. Use filters to find specific colors
|
||||
3. Review color specifications and samples
|
||||
4. Check availability and inventory
|
||||
5. Select appropriate color for application
|
||||
6. Generate color specification document
|
||||
|
||||
### Color Categories
|
||||
- **Industrial Colors**: Standard industrial paint colors
|
||||
- **Safety Colors**: Safety and warning color standards
|
||||
- **Custom Colors**: Project-specific color requirements
|
||||
- **Environmental Colors**: Eco-friendly paint options
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Always verify color codes before application
|
||||
- ✅ Check color compatibility with substrate
|
||||
- ✅ Document color selection and approval process
|
||||
- ✅ Maintain color samples for reference
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify color matches approved specifications
|
||||
- ✅ Test colors on sample materials first
|
||||
- ✅ Ensure proper lighting conditions for color evaluation
|
||||
- ✅ Document any color variations or issues
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Color not matching**: Check lighting conditions and substrate
|
||||
2. **Color code not found**: Verify color code format and database
|
||||
3. **Approval pending**: Contact the paint supervisor for approval
|
||||
|
||||
### Getting Help
|
||||
- Contact the Paint department for technical support
|
||||
- Consult color standards and specifications
|
||||
- Check the color library for similar applications
|
||||
@@ -1,143 +0,0 @@
|
||||
# Construction Paint Log User Guide
|
||||
|
||||
## What is the Construction Paint Log Module?
|
||||
|
||||
The Construction Paint Log module tracks and documents all painting activities during construction phases. This module helps monitor paint application progress, ensure quality standards, and maintain comprehensive records of painting operations with automatic calculation system for paint consumption.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Construction Paint Log:
|
||||
1. Login to the system
|
||||
2. Click on **Paint** in the main menu
|
||||
3. Select **Construction Paint Log** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Paint Activity Logging**: Record all painting activities and progress
|
||||
- **Automatic Calculations**: System automatically calculates areas and paint consumption
|
||||
- **Quality Control**: Monitor paint application quality and standards
|
||||
- **Progress Tracking**: Track painting progress across different areas
|
||||
- **Documentation**: Maintain comprehensive paint activity records
|
||||
|
||||
### Secondary Functions
|
||||
- **Photo Documentation**: Upload photos of paint application
|
||||
- **Weather Monitoring**: Track weather conditions during painting
|
||||
- **Material Tracking**: Monitor paint material usage and inventory
|
||||
- **Report Generation**: Generate paint activity reports
|
||||
|
||||
## Automatic Calculation System
|
||||
|
||||
The Construction Paint Log includes an intelligent calculation system that automatically computes:
|
||||
|
||||
### 1. Pipe Area Calculations
|
||||
**Formula**: Total Line = (π × DN1) + cutting + (π × DN2) + cutting + (π × DN3) + cutting
|
||||
- System calculates pipe circumference using π (pi) × diameter
|
||||
- Adds cutting lengths for each section
|
||||
- Automatically updates pipe area (pipe_m2)
|
||||
|
||||
### 2. Fittings Area Calculations
|
||||
**Formula**: Total Fittings = Elbow + Tee + Reductions + Vent + Cap + Flange
|
||||
- Sums all fitting component areas
|
||||
- Updates fittings_m2 automatically
|
||||
|
||||
### 3. Total Surface Area
|
||||
**Formula**: Total Area = Pipe Area + Fittings Area
|
||||
- Combines pipe and fittings areas
|
||||
- Provides total surface area for painting (total_m2)
|
||||
|
||||
### 4. Paint Consumption Calculations
|
||||
**Formula**: Layer Consumption = Paint System Consumption × Total Area
|
||||
- **First Layer**: consumption_paint_kg_1 × total_m2
|
||||
- **Second Layer**: consumption_paint_kg_2 × total_m2
|
||||
- **Third Layer**: consumption_paint_kg_3 × total_m2
|
||||
- **Total Paint**: Sum of all three layers
|
||||
|
||||
### Automatic Field Updates
|
||||
When you enter values for:
|
||||
- **DN1, DN2, DN3** (pipe diameters) → Updates pipe area
|
||||
- **Cutting_mm** (cutting lengths) → Updates pipe calculations
|
||||
- **Fitting areas** (elbow, tee, etc.) → Updates fittings total
|
||||
- **Paint system selection** → Updates all paint consumption values
|
||||
|
||||
## How to Use
|
||||
|
||||
### Logging Paint Activities
|
||||
1. Click **"New Paint Log Entry"** button
|
||||
2. Enter pipe specifications (DN1, DN2, DN3, cutting lengths)
|
||||
3. Input fitting areas (elbow, tee, reductions, etc.)
|
||||
4. Select painting system type - **calculations update automatically**
|
||||
5. Record weather conditions and temperature
|
||||
6. Upload photos of the work
|
||||
7. Add any notes or observations
|
||||
8. Click **"Save Entry"**
|
||||
|
||||
### Using the Calculation System
|
||||
1. **Enter Pipe Data**: Input DN values and cutting measurements
|
||||
2. **Add Fitting Areas**: Enter areas for each fitting type
|
||||
3. **Select Paint System**: Choose from predefined paint systems
|
||||
4. **Review Calculations**: System automatically calculates:
|
||||
- Total pipe area
|
||||
- Total fittings area
|
||||
- Total surface area
|
||||
- Paint consumption for each layer
|
||||
- Total paint required
|
||||
|
||||
### Quality Control Process
|
||||
1. Review paint application specifications
|
||||
2. Check surface preparation requirements
|
||||
3. Verify calculated paint quantities match actual usage
|
||||
4. Monitor application technique
|
||||
5. Document any issues or deviations
|
||||
6. Record quality inspection results
|
||||
|
||||
### Paint Activity Categories
|
||||
- **Surface Preparation**: Cleaning, sanding, priming activities
|
||||
- **Paint Application**: Primary paint application work
|
||||
- **Touch-up Work**: Minor repairs and touch-up activities
|
||||
- **Final Inspection**: Quality control and final approval
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Enter accurate pipe dimensions for correct calculations
|
||||
- ✅ Verify fitting areas before proceeding
|
||||
- ✅ Select appropriate paint system for automatic consumption calculation
|
||||
- ✅ Document all paint activities immediately after completion
|
||||
- ✅ Include detailed weather and environmental conditions
|
||||
- ✅ Take clear photos of work progress and quality
|
||||
|
||||
### Calculation Best Practices
|
||||
- ✅ Double-check DN measurements for accuracy
|
||||
- ✅ Verify cutting lengths are in correct units (mm)
|
||||
- ✅ Ensure fitting areas are measured correctly
|
||||
- ✅ Confirm paint system selection matches specifications
|
||||
- ✅ Review calculated values before starting work
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Compare calculated paint consumption with actual usage
|
||||
- ✅ Verify paint specifications before application
|
||||
- ✅ Check surface preparation quality
|
||||
- ✅ Monitor paint application technique
|
||||
- ✅ Document any quality issues or concerns
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Calculations not updating**: Check if all required fields are filled
|
||||
2. **Incorrect paint consumption**: Verify paint system selection
|
||||
3. **Area calculations wrong**: Double-check DN and cutting measurements
|
||||
4. **Cannot save entry**: Check all required fields are completed
|
||||
5. **Photo upload fails**: Verify file format and size
|
||||
|
||||
### Calculation Troubleshooting
|
||||
- **Wrong pipe area**: Verify DN values are in correct units
|
||||
- **Fitting totals incorrect**: Check individual fitting area entries
|
||||
- **Paint consumption too high/low**: Confirm paint system selection
|
||||
- **Total area mismatch**: Review both pipe and fitting calculations
|
||||
|
||||
### Getting Help
|
||||
- Contact the Paint department for technical support
|
||||
- Consult paint specifications and procedures
|
||||
- Check previous paint log entries for reference
|
||||
- Review calculation formulas in this guide
|
||||
@@ -1,231 +0,0 @@
|
||||
# Converter-Map Translation System Guide
|
||||
|
||||
## Overview
|
||||
|
||||
The Converter-Map Translation System is an automated term translation feature integrated into the DevQMS Report Builder. It allows automatic translation of terms in Excel/PDF templates using predefined term mappings stored in the converter-map settings.
|
||||
|
||||
## How It Works
|
||||
|
||||
The system automatically detects and replaces term patterns in the following formats:
|
||||
- `TERM_en` → Replaces with English equivalent
|
||||
- `TERM_ru` → Replaces with Russian equivalent
|
||||
- `TERM_tr` → Replaces with Turkish equivalent (original term)
|
||||
- `{TERM_en}` → Placeholder format for English
|
||||
- `{TERM_ru}` → Placeholder format for Russian
|
||||
- `{TERM_tr}` → Placeholder format for Turkish
|
||||
|
||||
## Setting Up Converter-Map
|
||||
|
||||
### 1. Access Converter-Map Settings
|
||||
|
||||
Navigate to **Admin Panel** → **Settings** → **Converter Map**
|
||||
|
||||
### 2. Add Translation Entries
|
||||
|
||||
Fill in the grid with your term translations:
|
||||
|
||||
| Term | Term_eng | Term_ru |
|
||||
|------|----------|---------|
|
||||
| STELLAR | here is STELLAR to_en equivalent | buraya STELLAR'ın to_ru karşılığı |
|
||||
| WELD | Welding Process | Процесс сварки |
|
||||
| INSPECTION | Quality Inspection | Контроль качества |
|
||||
|
||||
### 3. Save Changes
|
||||
|
||||
Click the **"Store Converter Map"** button to save your translations.
|
||||
|
||||
> **Note:** The system automatically clears the cache when you save changes, so translations are immediately available.
|
||||
|
||||
## Using Translations in Templates
|
||||
|
||||
### 1. Excel Template Usage
|
||||
|
||||
In your Excel templates, use the following patterns:
|
||||
|
||||
```excel
|
||||
Cell A1: "STELLAR_en Procedure"
|
||||
Result: "here is STELLAR to_en equivalent Procedure"
|
||||
|
||||
Cell B1: "Процедура STELLAR_ru"
|
||||
Result: "Процедура buraya STELLAR'ın to_ru karşılığı"
|
||||
|
||||
Cell C1: "Test {WELD_en} Report"
|
||||
Result: "Test Welding Process Report"
|
||||
```
|
||||
|
||||
### 2. File Name Templates
|
||||
|
||||
Use translation patterns in file naming:
|
||||
|
||||
```
|
||||
Template: "Report_STELLAR_en_{iso_number}.xlsx"
|
||||
Result: "Report_here is STELLAR to_en equivalent_12345.xlsx"
|
||||
|
||||
Template: "{INSPECTION_ru}_Document_{date}.pdf"
|
||||
Result: "Контроль качества_Document_2024-01-15.pdf"
|
||||
```
|
||||
|
||||
### 3. PDF Content
|
||||
|
||||
The same patterns work in PDF content:
|
||||
- Text blocks
|
||||
- Headers and footers
|
||||
- Dynamic content areas
|
||||
- Formula results
|
||||
|
||||
## Integration Points
|
||||
|
||||
The converter-map system is automatically applied at these stages:
|
||||
|
||||
### 1. Excel Processing
|
||||
- **Before workPermitReplacerExcel2**: Spreadsheet-level replacements
|
||||
- **After standard placeholders**: Cell-by-cell content replacement
|
||||
- **In formulas**: Formula content translation
|
||||
|
||||
### 2. File Naming
|
||||
- Applied to `fileNameTemplate` parameter
|
||||
- Executed after standard placeholder replacement
|
||||
|
||||
### 3. Data Processing
|
||||
- **Master data**: Template-level translations
|
||||
- **Detail data**: Row-by-row translations in both single and multiple modes
|
||||
- **Empty sections**: Cleanup translations for unused sections
|
||||
|
||||
## Advanced Features
|
||||
|
||||
### 1. Cache Management
|
||||
- Translations are cached for 1 hour for performance
|
||||
- Cache automatically clears when converter-map is updated
|
||||
- Manual cache clearing: `Cache::forget('converter_map_data')`
|
||||
|
||||
### 2. Pattern Recognition
|
||||
The system uses regex patterns to identify translation targets:
|
||||
```php
|
||||
// Word boundary patterns
|
||||
/(\w+)_en\b/ // Matches: STELLAR_en, WELD_en
|
||||
/(\w+)_ru\b/ // Matches: STELLAR_ru, WELD_ru
|
||||
/(\w+)_tr\b/ // Matches: STELLAR_tr, WELD_tr
|
||||
|
||||
// Placeholder patterns
|
||||
/\{(\w+)_en\}/ // Matches: {STELLAR_en}, {WELD_en}
|
||||
/\{(\w+)_ru\}/ // Matches: {STELLAR_ru}, {WELD_ru}
|
||||
/\{(\w+)_tr\}/ // Matches: {STELLAR_tr}, {WELD_tr}
|
||||
```
|
||||
|
||||
### 3. Error Handling
|
||||
- Non-existent terms remain unchanged
|
||||
- System continues processing even if translation fails
|
||||
- Comprehensive logging for debugging
|
||||
|
||||
## Best Practices
|
||||
|
||||
### 1. Term Naming Convention
|
||||
- Use UPPERCASE for consistency
|
||||
- Use descriptive, single-word terms when possible
|
||||
- Example: `STELLAR`, `WELD`, `INSPECTION`, `PROCEDURE`
|
||||
|
||||
### 2. Translation Quality
|
||||
- Ensure all three language fields are filled
|
||||
- Use consistent terminology across documents
|
||||
- Test translations in actual templates
|
||||
|
||||
### 3. Template Design
|
||||
- Place translation patterns in appropriate contexts
|
||||
- Consider text length differences between languages
|
||||
- Test with actual data before production use
|
||||
|
||||
## Example Implementation
|
||||
|
||||
### 1. Complete Converter-Map Setup
|
||||
```
|
||||
Term: STELLAR
|
||||
Term_eng: Stellar Development LLC
|
||||
Term_ru: ООО Стеллар Девелопмент
|
||||
|
||||
Term: QC
|
||||
Term_eng: Quality Control
|
||||
Term_ru: Контроль качества
|
||||
|
||||
Term: WELD
|
||||
Term_eng: Welding
|
||||
Term_ru: Сварка
|
||||
```
|
||||
|
||||
### 2. Template Usage
|
||||
```excel
|
||||
// English Report Template
|
||||
A1: "STELLAR_en QC_en Report"
|
||||
A2: "WELD_en Inspection Results"
|
||||
|
||||
// Russian Report Template
|
||||
A1: "Отчет STELLAR_ru по QC_ru"
|
||||
A2: "Результаты WELD_ru контроля"
|
||||
|
||||
// Mixed Language Template
|
||||
A1: "Company: STELLAR_en"
|
||||
A2: "Компания: STELLAR_ru"
|
||||
A3: "Process: {WELD_en}"
|
||||
A4: "Процесс: {WELD_ru}"
|
||||
```
|
||||
|
||||
### 3. Expected Results
|
||||
```
|
||||
English Output:
|
||||
- "Stellar Development LLC Quality Control Report"
|
||||
- "Welding Inspection Results"
|
||||
|
||||
Russian Output:
|
||||
- "Отчет ООО Стеллар Девелопмент по Контроль качества"
|
||||
- "Результаты Сварка контроля"
|
||||
|
||||
Mixed Output:
|
||||
- "Company: Stellar Development LLC"
|
||||
- "Компания: ООО Стеллар Девелопмент"
|
||||
- "Process: Welding"
|
||||
- "Процесс: Сварка"
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### 1. Translations Not Working
|
||||
- Check if converter-map entries are saved properly
|
||||
- Verify term names match exactly (case-sensitive)
|
||||
- Clear cache manually if needed: `Cache::forget('converter_map_data')`
|
||||
|
||||
### 2. Performance Issues
|
||||
- Cache is enabled by default (1-hour TTL)
|
||||
- Large converter-maps may impact initial load
|
||||
- Consider splitting very large term lists
|
||||
|
||||
### 3. Pattern Conflicts
|
||||
- Use word boundaries to prevent partial matches
|
||||
- Test complex patterns in isolated templates first
|
||||
- Check logs for replacement details
|
||||
|
||||
## Technical Implementation
|
||||
|
||||
The system consists of two main functions:
|
||||
|
||||
### 1. `converterMapReplacer()`
|
||||
- Processes Excel/PDF spreadsheets
|
||||
- Handles cell-by-cell replacement
|
||||
- Returns modified spreadsheet object
|
||||
|
||||
### 2. `converterMapStringReplacer()`
|
||||
- Processes string content
|
||||
- Used for file names and text blocks
|
||||
- Returns modified string
|
||||
|
||||
Both functions are automatically called during the report building process and require no manual intervention.
|
||||
|
||||
## Integration with Report Builder
|
||||
|
||||
The converter-map system is seamlessly integrated into the existing report builder workflow:
|
||||
|
||||
1. **Template Loading** → Standard Excel template loaded
|
||||
2. **Work Permit Replacement** → Work permit placeholders processed
|
||||
3. **Converter-Map Translation** → Term translations applied
|
||||
4. **Standard Placeholders** → Regular data placeholders processed
|
||||
5. **Final Output** → PDF generation with all translations
|
||||
|
||||
This ensures that term translations work alongside all existing functionality without conflicts.
|
||||
@@ -1,77 +0,0 @@
|
||||
# Cut List User Guide
|
||||
|
||||
## What is the Cut List Module?
|
||||
|
||||
The Cut List module manages material cutting lists and specifications for manufacturing and fabrication processes. This module helps optimize material usage, track cutting operations, and ensure accurate material specifications for various project components.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Cut List:
|
||||
1. Login to the system
|
||||
2. Click on **Manufacturing** in the main menu
|
||||
3. Select **Cut List** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Cut List Generation**: Create detailed cutting lists for materials
|
||||
- **Material Optimization**: Optimize material usage and minimize waste
|
||||
- **Cutting Specifications**: Define precise cutting dimensions and tolerances
|
||||
- **Progress Tracking**: Track cutting operations and completion status
|
||||
|
||||
### Secondary Functions
|
||||
- **Material Inventory**: Track available materials and stock levels
|
||||
- **Cutting Reports**: Generate cutting operation reports
|
||||
- **Quality Control**: Monitor cutting quality and accuracy
|
||||
- **Documentation**: Maintain cutting specifications and records
|
||||
|
||||
## How to Use
|
||||
|
||||
### Creating a New Cut List
|
||||
1. Click **"New Cut List"** button
|
||||
2. Select the project and material type
|
||||
3. Enter material specifications and dimensions
|
||||
4. Define cutting requirements and tolerances
|
||||
5. Set priority and schedule
|
||||
6. Assign cutting personnel
|
||||
7. Click **"Generate Cut List"**
|
||||
|
||||
### Material Optimization Process
|
||||
1. Review material requirements and specifications
|
||||
2. Analyze available material stock
|
||||
3. Optimize cutting patterns for minimal waste
|
||||
4. Calculate material usage and costs
|
||||
5. Generate optimized cutting instructions
|
||||
6. Review and approve cutting plan
|
||||
|
||||
### Cut List Categories
|
||||
- **Pipe Cutting**: Pipe cutting lists and specifications
|
||||
- **Plate Cutting**: Plate material cutting operations
|
||||
- **Structural Cutting**: Structural steel cutting requirements
|
||||
- **Custom Cutting**: Special cutting requirements
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Always verify material specifications before cutting
|
||||
- ✅ Optimize cutting patterns to minimize waste
|
||||
- ✅ Document all cutting operations and results
|
||||
- ✅ Follow safety procedures during cutting operations
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify cutting dimensions and tolerances
|
||||
- ✅ Check material quality before cutting
|
||||
- ✅ Monitor cutting equipment calibration
|
||||
- ✅ Document any cutting issues or deviations
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Material shortage**: Check inventory and order additional materials
|
||||
2. **Cutting errors**: Verify cutting specifications and equipment settings
|
||||
3. **Quality issues**: Review cutting procedures and equipment maintenance
|
||||
|
||||
### Getting Help
|
||||
- Contact the Manufacturing department for technical support
|
||||
- Consult cutting specifications and procedures
|
||||
- Check material inventory and availability
|
||||
@@ -1,91 +0,0 @@
|
||||
# Dashboard Stats API Usage Guide / Dashboard İstatistikleri API Kullanım Kılavuzu
|
||||
|
||||
This guide details how to use the Dashboard Stats API endpoint (`/api/stats/dashboard-stats`).
|
||||
Bu kılavuz, Dashboard İstatistikleri API uç noktasının (`/api/stats/dashboard-stats`) nasıl kullanılacağını detaylandırır.
|
||||
|
||||
---
|
||||
|
||||
## 1. Endpoint Structure / Uç Nokta Yapısı
|
||||
|
||||
**URL:** `GET /api/stats/dashboard-stats`
|
||||
**Security / Güvenlik:** Static Hash (X-Api-Hash)
|
||||
|
||||
This endpoint is protected by a static hash instead of standard User Authentication (Bearer Token).
|
||||
Bu uç nokta, standart Kullanıcı Kimlik Doğrulaması (Bearer Token) yerine statik bir hash ile korunmaktadır.
|
||||
|
||||
### Headers / Başlıklar
|
||||
|
||||
| Header | Value / Değer | Required / Zorunlu | Description / Açıklama |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `X-Api-Hash` | `String` | **Yes / Evet** | The static API hash defined in `.env` (`API_STATIC_HASH`). / `.env` dosyasında tanımlanan statik API anahtarı. |
|
||||
| `Accept` | `application/json` | No / Hayır | Recommended for JSON response. / JSON yanıtı için önerilir. |
|
||||
|
||||
---
|
||||
|
||||
## 2. Response Structure / Yanıt Yapısı
|
||||
|
||||
The endpoint returns aggregated statistics for the project dashboard.
|
||||
Uç nokta, proje panosu için toplanmış istatistikleri döndürür.
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"data": {
|
||||
"wdi_monthly": [
|
||||
{ "month": "2023-10", "shop": 150, "field": 200, "total": 350 },
|
||||
...
|
||||
],
|
||||
"spool_progress": {
|
||||
"On Going": 15,
|
||||
"Completed": 45,
|
||||
...
|
||||
},
|
||||
"ndt_backlog": {
|
||||
"RT": 5,
|
||||
"UT": 2
|
||||
},
|
||||
"handover_status": { ... },
|
||||
"welding_equipment": { ... }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3. Example Usage / Örnek Kullanım
|
||||
|
||||
### cURL
|
||||
|
||||
```bash
|
||||
curl -X GET "https://your-domain.com/api/stats/dashboard-stats" \
|
||||
-H "X-Api-Hash: YOUR_SECRET_HASH_KEY" \
|
||||
-H "Accept: application/json"
|
||||
```
|
||||
|
||||
### JavaScript (Fetch)
|
||||
|
||||
```javascript
|
||||
fetch('https://your-domain.com/api/stats/dashboard-stats', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'X-Api-Hash': 'YOUR_SECRET_HASH_KEY'
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
if (!response.ok) throw new Error('Unauthorized');
|
||||
return response.json();
|
||||
})
|
||||
.then(data => console.log(data))
|
||||
.catch(error => console.error('Error:', error));
|
||||
```
|
||||
|
||||
### Configuration / Yapılandırma
|
||||
|
||||
Ensure the hash is set in your `.env` file:
|
||||
Hash anahtarının `.env` dosyanızda ayarlandığından emin olun:
|
||||
|
||||
```bash
|
||||
API_STATIC_HASH=your-secure-hash-key-here
|
||||
```
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
# Dashboard User Guide
|
||||
|
||||
## What is the Dashboard Module?
|
||||
|
||||
The Dashboard module provides a comprehensive overview of project status, key metrics, and important information at a glance. This module helps users monitor project progress, track performance indicators, and access critical information quickly.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Dashboard:
|
||||
1. Login to the system
|
||||
2. The Dashboard is displayed as the main landing page
|
||||
3. Or click on **Dashboard** in the main menu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Project Overview**: View overall project status and progress
|
||||
- **Key Performance Indicators**: Monitor important project metrics
|
||||
- **Quick Access**: Access frequently used modules and functions
|
||||
- **Real-time Updates**: View real-time project data and status
|
||||
|
||||
### Secondary Functions
|
||||
- **Customizable Widgets**: Configure dashboard layout and widgets
|
||||
- **Alert System**: Receive notifications for important events
|
||||
- **Report Integration**: Access key reports and summaries
|
||||
- **Navigation Hub**: Quick navigation to other modules
|
||||
|
||||
## How to Use
|
||||
|
||||
### Dashboard Navigation
|
||||
1. **Project Status Widget**: View overall project completion status
|
||||
2. **Recent Activities**: See latest project activities and updates
|
||||
3. **Quick Actions**: Access common functions and modules
|
||||
4. **Alerts and Notifications**: Review important alerts and messages
|
||||
5. **Performance Metrics**: Monitor key performance indicators
|
||||
|
||||
### Customizing Dashboard
|
||||
1. Click **"Customize Dashboard"** button
|
||||
2. Add or remove widgets as needed
|
||||
3. Rearrange widget positions
|
||||
4. Configure widget settings
|
||||
5. Save dashboard layout
|
||||
|
||||
### Dashboard Widgets
|
||||
- **Project Progress**: Overall project completion percentage
|
||||
- **Quality Metrics**: Quality control statistics and trends
|
||||
- **Safety Alerts**: Safety incidents and compliance status
|
||||
- **Resource Utilization**: Equipment and personnel utilization
|
||||
- **Financial Summary**: Cost tracking and budget status
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Check dashboard regularly for project updates
|
||||
- ✅ Configure widgets to show most relevant information
|
||||
- ✅ Monitor alerts and notifications promptly
|
||||
- ✅ Use quick actions for efficient navigation
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify dashboard data accuracy regularly
|
||||
- ✅ Report any data discrepancies immediately
|
||||
- ✅ Keep dashboard layout organized and relevant
|
||||
- ✅ Review performance metrics for trends
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Widget not loading**: Refresh page or check internet connection
|
||||
2. **Data not updating**: Check system status or contact administrator
|
||||
3. **Layout issues**: Reset dashboard layout or clear browser cache
|
||||
|
||||
### Getting Help
|
||||
- Contact the IT department for technical support
|
||||
- Check system status and maintenance schedules
|
||||
- Consult the user manual for specific widget configurations
|
||||
@@ -1,308 +0,0 @@
|
||||
# DataGrid Validation Callback Sistemi
|
||||
|
||||
Bu belge, DataGrid sütunlarında özel ve asenkron validation callback kullanımını açıklar.
|
||||
|
||||
## Genel Bakış
|
||||
|
||||
DataGrid sütunları için iki tür validation callback desteği mevcuttur:
|
||||
|
||||
| Tip | Açıklama | Kullanım |
|
||||
|-----|----------|----------|
|
||||
| `custom` | Senkron validation | Varsayılan, hızlı kontroller için |
|
||||
| `async` | Asenkron validation | API çağrısı gerektiren kontroller için |
|
||||
|
||||
## Dosya Yapısı
|
||||
|
||||
```
|
||||
resources/views/components/table/datagrid/
|
||||
├── validation-callback/
|
||||
│ ├── wpq-follow-up/
|
||||
│ │ ├── js-dia_min.blade.php
|
||||
│ │ ├── js-dia_max.blade.php
|
||||
│ │ ├── js-thk_min.blade.php
|
||||
│ │ └── js-thk_max.blade.php
|
||||
│ └── [diğer-modüller]/
|
||||
│ └── js-[sütun_adı].blade.php
|
||||
├── float.blade.php
|
||||
├── decimal.blade.php
|
||||
├── integer.blade.php
|
||||
├── string.blade.php
|
||||
├── date.blade.php
|
||||
└── ...
|
||||
```
|
||||
|
||||
## Kullanım
|
||||
|
||||
### 1. Blade Dosyasında Sütun Tanımı
|
||||
|
||||
`relationDatas` dizisinde `validationType` parametresini ekleyin:
|
||||
|
||||
```php
|
||||
$relationDatas = [
|
||||
'dia_min' => [
|
||||
'type' => 'float',
|
||||
'validationType' => 'async' // async veya custom (varsayılan: custom)
|
||||
],
|
||||
'dia_max' => [
|
||||
'type' => 'float',
|
||||
'validationType' => 'async'
|
||||
],
|
||||
'thk_min' => [
|
||||
'type' => 'float',
|
||||
'validationType' => 'async'
|
||||
],
|
||||
'thk_max' => [
|
||||
'type' => 'float',
|
||||
'validationType' => 'async'
|
||||
],
|
||||
// validationType belirtilmezse 'custom' kullanılır
|
||||
'other_field' => [
|
||||
'type' => 'float'
|
||||
],
|
||||
];
|
||||
```
|
||||
|
||||
### 2. Validation Callback Dosyası Oluşturma
|
||||
|
||||
Callback dosyaları şu dizinde oluşturulmalıdır:
|
||||
```
|
||||
resources/views/components/table/datagrid/validation-callback/{modül-adı}/js-{sütun_adı}.blade.php
|
||||
```
|
||||
|
||||
**Örnek: Senkron (Custom) Validation**
|
||||
|
||||
```javascript
|
||||
// js-my_field.blade.php
|
||||
var result = true;
|
||||
|
||||
if (e.value < 0) {
|
||||
e.rule.message = "Değer sıfırdan küçük olamaz";
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
```
|
||||
|
||||
**Örnek: Asenkron (Async) Validation**
|
||||
|
||||
```javascript
|
||||
// js-dia_min.blade.php
|
||||
const d = $.Deferred();
|
||||
|
||||
// API parametrelerini hazırla
|
||||
let materials = '';
|
||||
if (e.data.material_group_1 || e.data.material_group_2) {
|
||||
materials = '&materials=';
|
||||
if (e.data.material_group_1) {
|
||||
materials += e.data.material_group_1;
|
||||
}
|
||||
if (e.data.material_group_2) {
|
||||
materials += (materials.endsWith('=') ? '' : ',') + e.data.material_group_2;
|
||||
}
|
||||
}
|
||||
|
||||
// API'ye istek at
|
||||
$.getJSON("{{autocomplete_type('naks_welder_diameter_min')}}?value=" + encodeURIComponent(e.data.naks_no) + materials, function(responseJSON) {
|
||||
let result = true; // Varsayılan olarak valid
|
||||
|
||||
if (typeof responseJSON.error === "string") {
|
||||
// Hata durumu
|
||||
e.rule.message = responseJSON.error;
|
||||
result = false;
|
||||
} else {
|
||||
// Başarılı yanıt - değeri kontrol et
|
||||
var start_min = responseJSON.start_min;
|
||||
result = (e.value >= start_min);
|
||||
|
||||
if (!result) {
|
||||
e.rule.message = "Değer en az " + start_min + " olmalıdır";
|
||||
}
|
||||
}
|
||||
|
||||
// Promise'i çöz
|
||||
d.resolve(result);
|
||||
});
|
||||
|
||||
// Promise döndür
|
||||
return d.promise();
|
||||
```
|
||||
|
||||
## Desteklenen Sütun Tipleri
|
||||
|
||||
Aşağıdaki sütun tipleri `validationType` parametresini destekler:
|
||||
|
||||
| Dosya | Tip | Destekleniyor |
|
||||
|-------|-----|---------------|
|
||||
| `float.blade.php` | Ondalıklı sayı | ✅ |
|
||||
| `decimal.blade.php` | Ondalıklı sayı | ✅ |
|
||||
| `integer.blade.php` | Tam sayı | ✅ |
|
||||
| `bigint.blade.php` | Büyük tam sayı | ✅ |
|
||||
| `string.blade.php` | Metin | ✅ |
|
||||
| `date.blade.php` | Tarih | ✅ |
|
||||
| `long-text.blade.php` | Uzun metin | ✅ |
|
||||
| `json.blade.php` | JSON | ✅ |
|
||||
| `select.blade.php` | Seçim | ✅ |
|
||||
| `select-dropdown.blade.php` | Dropdown | ✅ |
|
||||
| `select-dropdown2.blade.php` | Dropdown 2 | ✅ |
|
||||
|
||||
## Önemli Notlar
|
||||
|
||||
### 1. Değişken Scope'u
|
||||
|
||||
Asenkron callback'lerde `result` değişkeni callback fonksiyonunun **başında** tanımlanmalıdır:
|
||||
|
||||
```javascript
|
||||
$.getJSON(url, function(response) {
|
||||
let result = true; // ✅ Doğru - başta tanımla
|
||||
|
||||
if (condition) {
|
||||
result = false;
|
||||
}
|
||||
|
||||
d.resolve(result);
|
||||
});
|
||||
```
|
||||
|
||||
❌ **Yanlış Kullanım:**
|
||||
```javascript
|
||||
$.getJSON(url, function(response) {
|
||||
if (condition) {
|
||||
var result = false; // ❌ Yanlış - scope sorunu
|
||||
}
|
||||
|
||||
d.resolve(result); // result undefined olabilir!
|
||||
});
|
||||
```
|
||||
|
||||
### 2. Promise Döndürme
|
||||
|
||||
Async validation için mutlaka `$.Deferred()` kullanın ve `d.promise()` döndürün:
|
||||
|
||||
```javascript
|
||||
const d = $.Deferred();
|
||||
|
||||
// ... async işlemler ...
|
||||
|
||||
d.resolve(result); // boolean değer ile çöz
|
||||
|
||||
return d.promise(); // promise döndür
|
||||
```
|
||||
|
||||
### 3. Hata Mesajları
|
||||
|
||||
Validation başarısız olduğunda `e.rule.message` ayarlayın:
|
||||
|
||||
```javascript
|
||||
if (!result) {
|
||||
e.rule.message = "Özel hata mesajınız";
|
||||
}
|
||||
```
|
||||
|
||||
### 4. API Endpoint Ayarı
|
||||
|
||||
API endpoint'lerini `autocomplete_type()` veya `row_detail_url()` helper'ları ile oluşturun:
|
||||
|
||||
```javascript
|
||||
// autocomplete_type kullanımı
|
||||
$.getJSON("{{autocomplete_type('naks_welder_diameter_min')}}?value=" + value);
|
||||
|
||||
// row_detail_url kullanımı
|
||||
$.getJSON("{{row_detail_url('materials', 'steel_grade')}}?value=" + value);
|
||||
```
|
||||
|
||||
## Akış Diyagramı
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[Kullanıcı Veri Girer] --> B[DataGrid validationCallback çağırır]
|
||||
B --> C{Validation Tipi?}
|
||||
|
||||
C -->|type: custom| D[Senkron Kontrol]
|
||||
C -->|type: async| E[Asenkron Kontrol]
|
||||
|
||||
D --> F[return true/false]
|
||||
|
||||
E --> G["$.Deferred() oluştur"]
|
||||
G --> H["$.getJSON() API çağrısı"]
|
||||
H --> I["d.resolve(result)"]
|
||||
I --> J["return d.promise()"]
|
||||
|
||||
F --> K{Sonuç}
|
||||
J --> K
|
||||
|
||||
K -->|result = true| L[✅ Kaydet]
|
||||
K -->|result = false| M[❌ Hata mesajı göster]
|
||||
|
||||
style A fill:#e1f5fe
|
||||
style B fill:#fff3e0
|
||||
style C fill:#fce4ec
|
||||
style D fill:#e8f5e9
|
||||
style E fill:#f3e5f5
|
||||
style L fill:#c8e6c9
|
||||
style M fill:#ffcdd2
|
||||
```
|
||||
|
||||
## Örnek: WPQ Follow-Up Modülü
|
||||
|
||||
WPQ Follow-Up modülünde `dia_min`, `dia_max`, `thk_min`, `thk_max` sütunları için async validation uygulanmıştır:
|
||||
|
||||
**wpq-follow-up.blade.php:**
|
||||
```php
|
||||
$relationDatas = [
|
||||
'dia_min' => [
|
||||
'type' => 'float',
|
||||
'validationType' => 'async'
|
||||
],
|
||||
'dia_max' => [
|
||||
'type' => 'float',
|
||||
'validationType' => 'async'
|
||||
],
|
||||
'thk_min' => [
|
||||
'type' => 'float',
|
||||
'validationType' => 'async'
|
||||
],
|
||||
'thk_max' => [
|
||||
'type' => 'float',
|
||||
'validationType' => 'async'
|
||||
],
|
||||
];
|
||||
```
|
||||
|
||||
Bu sütunlar için validation callback'ler şu konumda bulunur:
|
||||
```
|
||||
resources/views/components/table/datagrid/validation-callback/wpq-follow-up/
|
||||
├── js-dia_min.blade.php
|
||||
├── js-dia_max.blade.php
|
||||
├── js-thk_min.blade.php
|
||||
└── js-thk_max.blade.php
|
||||
```
|
||||
|
||||
## Sık Karşılaşılan Hatalar
|
||||
|
||||
### 1. Validation Mesajı Görünmüyor
|
||||
|
||||
**Sebep:** `validationType` ayarlanmamış veya `result` değişkeni undefined.
|
||||
|
||||
**Çözüm:**
|
||||
- `relationDatas` içinde `'validationType' => 'async'` ekleyin
|
||||
- Callback başında `let result = true;` tanımlayın
|
||||
|
||||
### 2. Validation Çalışmıyor
|
||||
|
||||
**Sebep:** Callback dosyası bulunamıyor.
|
||||
|
||||
**Çözüm:**
|
||||
- Dosya yolunu kontrol edin: `validation-callback/{modül-adı}/js-{sütun_adı}.blade.php`
|
||||
- Dosya adının sütun adı ile eşleştiğinden emin olun
|
||||
|
||||
### 3. API Hatası
|
||||
|
||||
**Sebep:** Endpoint yanlış veya parametreler eksik.
|
||||
|
||||
**Çözüm:**
|
||||
- Console'da network sekmesini kontrol edin
|
||||
- `encodeURIComponent()` kullandığınızdan emin olun
|
||||
|
||||
---
|
||||
|
||||
*Son güncelleme: 2026-01-15*
|
||||
@@ -1,77 +0,0 @@
|
||||
# Deleted Joints User Guide
|
||||
|
||||
## What is the Deleted Joints Module?
|
||||
|
||||
The Deleted Joints module tracks and manages welding joints that have been removed or deleted from the project scope. This module helps maintain accurate records of joint changes, track modification history, and ensure proper documentation of joint deletions.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Deleted Joints:
|
||||
1. Login to the system
|
||||
2. Click on **Manufacturing** in the main menu
|
||||
3. Select **Deleted Joints** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Joint Deletion Tracking**: Record and track deleted welding joints
|
||||
- **Modification History**: Maintain complete history of joint changes
|
||||
- **Documentation**: Document reasons and approvals for joint deletions
|
||||
- **Audit Trail**: Provide audit trail for quality and compliance
|
||||
|
||||
### Secondary Functions
|
||||
- **Approval Workflow**: Manage approval process for joint deletions
|
||||
- **Report Generation**: Generate reports on deleted joints
|
||||
- **Impact Analysis**: Analyze impact of joint deletions on project
|
||||
- **Restoration Options**: Track options for joint restoration if needed
|
||||
|
||||
## How to Use
|
||||
|
||||
### Recording Joint Deletion
|
||||
1. Click **"Record Joint Deletion"** button
|
||||
2. Select the joint to be deleted
|
||||
3. Enter reason for deletion
|
||||
4. Attach supporting documentation
|
||||
5. Set approval requirements
|
||||
6. Submit for approval
|
||||
7. Track approval status
|
||||
|
||||
### Approval Process
|
||||
1. Review deletion request and documentation
|
||||
2. Verify deletion reason and impact
|
||||
3. Check for any dependencies
|
||||
4. Approve or reject deletion request
|
||||
5. Document decision and comments
|
||||
6. Update joint status
|
||||
|
||||
### Deletion Categories
|
||||
- **Design Changes**: Joints removed due to design modifications
|
||||
- **Quality Issues**: Joints deleted due to quality problems
|
||||
- **Scope Changes**: Joints removed due to scope modifications
|
||||
- **Technical Issues**: Joints deleted due to technical constraints
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Always document clear reasons for joint deletion
|
||||
- ✅ Obtain proper approvals before deletion
|
||||
- ✅ Consider impact on project schedule and cost
|
||||
- ✅ Maintain complete documentation trail
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify deletion approval before proceeding
|
||||
- ✅ Update related documentation and drawings
|
||||
- ✅ Notify affected departments and personnel
|
||||
- ✅ Monitor impact on project progress
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Cannot delete joint**: Check approval status and permissions
|
||||
2. **Missing documentation**: Ensure all required documents are attached
|
||||
3. **Approval workflow stuck**: Contact the project manager
|
||||
|
||||
### Getting Help
|
||||
- Contact the Manufacturing department for technical support
|
||||
- Consult the project manager for approval issues
|
||||
- Check deletion history for similar cases
|
||||
@@ -1,649 +0,0 @@
|
||||
# DevQMS Developer Get Started Guide
|
||||
|
||||
## Table of Contents
|
||||
1. [Project Overview](#project-overview)
|
||||
2. [Architecture Overview](#architecture-overview)
|
||||
3. [Core Components](#core-components)
|
||||
4. [Module System](#module-system)
|
||||
5. [DevExtreme Integration](#devextreme-integration)
|
||||
6. [Admin-AJAX System](#admin-ajax-system)
|
||||
7. [Save Trigger System](#save-trigger-system)
|
||||
8. [Batch Excel Operations](#batch-excel-operations)
|
||||
9. [Development Workflow](#development-workflow)
|
||||
10. [Common Patterns](#common-patterns)
|
||||
11. [Troubleshooting](#troubleshooting)
|
||||
|
||||
## Project Overview
|
||||
|
||||
DevQMS is a Quality Management System (QMS) built on Laravel framework with advanced features including:
|
||||
|
||||
- **Modular Architecture**: Each module (WeldLog, TestPackage, etc.) has its own Model, Controller, and View
|
||||
- **DevExtreme Integration**: Advanced UI components for data grids, forms, and charts
|
||||
- **Dynamic Form System**: Forms are generated dynamically based on database schema
|
||||
- **Excel Import/Export**: Batch operations for data management
|
||||
- **Role-based Access Control**: User permission system with different levels
|
||||
- **Real-time Data Processing**: Save triggers for automatic data synchronization
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
### Directory Structure
|
||||
|
||||
```
|
||||
app/
|
||||
├── Http/Controllers/
|
||||
│ ├── AdminController.php # Main CRUD controller
|
||||
│ ├── AdminAjaxController.php # AJAX request handler
|
||||
│ └── SaveTrigger/ # Automatic data processing
|
||||
├── DevExtreme/ # DevExtreme integration classes
|
||||
├── Models/ # Eloquent models
|
||||
└── Functions/ # Helper functions
|
||||
|
||||
resources/views/
|
||||
├── admin/ # Admin panel views
|
||||
│ └── type/ # Module views
|
||||
├── admin-ajax/ # AJAX response views
|
||||
├── components/ # Reusable components
|
||||
│ ├── blocks/ # Module blocks
|
||||
│ └── table/ # DataGrid components
|
||||
└── guide/ # Documentation
|
||||
|
||||
routes/
|
||||
└── web.php # Route definitions
|
||||
```
|
||||
|
||||
### Core Technologies
|
||||
|
||||
- **Backend**: Laravel 8+ with PHP 8+
|
||||
- **Frontend**: DevExtreme DataGrid, jQuery, Bootstrap
|
||||
- **Database**: MySQL with InnoDB
|
||||
- **File Storage**: Laravel Storage with local/cloud options
|
||||
- **Excel Processing**: Maatwebsite Excel package
|
||||
|
||||
## Core Components
|
||||
|
||||
### 1. AdminController.php
|
||||
|
||||
The central controller handling all CRUD operations for modules. Key methods:
|
||||
|
||||
```php
|
||||
// Read operations
|
||||
public function tableToJson(Request $request, string $tableName)
|
||||
public function getDetail(Request $request, string $tableName, string $columnName, string $value)
|
||||
|
||||
// Write operations
|
||||
public function insertJson(Request $request, string $tableName)
|
||||
public function saveJson(Request $request, string $tableName)
|
||||
public function removeJson(Request $request, string $tableName)
|
||||
|
||||
// Excel operations
|
||||
public function importExcel(Request $request, string $tableName)
|
||||
public function exportExcel(Request $request, string $tableName, string $fileName)
|
||||
```
|
||||
|
||||
**Important**: All modules use this centralized controller - no need to create individual controllers for basic CRUD operations.
|
||||
|
||||
### 2. AdminAjaxController.php
|
||||
|
||||
Handles AJAX requests through view-based routing:
|
||||
|
||||
```php
|
||||
public function index(Request $request, string $var) {
|
||||
$url = "admin-ajax.$var";
|
||||
return view($url, array("request" => $request));
|
||||
}
|
||||
```
|
||||
|
||||
AJAX views are located in `resources/views/admin-ajax/` and follow the naming pattern `{action}.blade.php`.
|
||||
|
||||
### 3. DevExtreme Integration
|
||||
|
||||
#### DbSet.php
|
||||
Custom query builder for DevExtreme DataGrid:
|
||||
|
||||
```php
|
||||
$dbSet = new DbSet($mySQL, 'table_name');
|
||||
$result = $dbSet->Select(['id', 'name'])
|
||||
->Filter(['status' => 'active'])
|
||||
->OrderBy('name')
|
||||
->SkipTake(0, 10)
|
||||
->AsArray();
|
||||
```
|
||||
|
||||
#### Utils.php
|
||||
Helper functions for data processing and SQL escaping.
|
||||
|
||||
## Module System
|
||||
|
||||
### Creating a New Module
|
||||
|
||||
1. **Create Model and Migration**:
|
||||
```php
|
||||
// app/Models/NewModule.php
|
||||
class NewModule extends Model {
|
||||
protected $table = 'new_modules';
|
||||
protected $primaryKey = 'id';
|
||||
public $timestamps = true;
|
||||
}
|
||||
```
|
||||
|
||||
2. **Create View Template**:
|
||||
```php
|
||||
// resources/views/admin/type/new-module.blade.php
|
||||
<?php
|
||||
use App\Models\NewModule;
|
||||
|
||||
$title = "New Module";
|
||||
$tableName = "new_modules";
|
||||
$listDatas = NewModule::orderBy("id","DESC")->paginate(setting('row_count'));
|
||||
|
||||
$blockGroup = [
|
||||
'General Info' => [
|
||||
'name',
|
||||
'description',
|
||||
],
|
||||
'Details' => [
|
||||
'status',
|
||||
'created_at',
|
||||
],
|
||||
];
|
||||
|
||||
$relationDatas = [
|
||||
'status' => [
|
||||
'type' => 'select',
|
||||
'datas' => [
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive'
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
$firstUploadFolder = 'NewModule/';
|
||||
$firstUploadTitle = 'Upload Files';
|
||||
?>
|
||||
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
@include("admin.type.document.upload")
|
||||
@include("components.blocks.module-block")
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
3. **Add to Types Table**:
|
||||
Register the module in the admin panel's Types section with:
|
||||
- Title: "New Module"
|
||||
- Slug: "new-module"
|
||||
- Fields: "name,description,status,created_at"
|
||||
|
||||
### Module Template Structure
|
||||
|
||||
#### sablon4.blade.php
|
||||
Base template for modules with these key variables:
|
||||
|
||||
```php
|
||||
$title = "Module Title"; // Page title
|
||||
$tableName = "table_name"; // Database table name
|
||||
$listDatas = Model::paginate(50); // Data source
|
||||
$blockGroup = []; // Field grouping
|
||||
$relationDatas = []; // Field type definitions
|
||||
$firstUploadFolder = 'ModuleName/'; // File upload folder
|
||||
$firstUploadTitle = 'Upload Title'; // Upload section title
|
||||
```
|
||||
|
||||
#### module-block.blade.php
|
||||
Handles the DataGrid integration and includes:
|
||||
- Column selection
|
||||
- Excel import/export
|
||||
- DataGrid component
|
||||
- Field type mapping
|
||||
|
||||
## DevExtreme Integration
|
||||
|
||||
### DataGrid Configuration
|
||||
|
||||
The DataGrid is configured in `resources/views/components/table/datagrid.blade.php` with:
|
||||
|
||||
```javascript
|
||||
var dataGrid = $("#dataGrid").dxDataGrid({
|
||||
dataSource: dataSource,
|
||||
keyExpr: "{{$tableName}}",
|
||||
allowColumnResizing: true,
|
||||
allowColumnReordering: true,
|
||||
showBorders: true,
|
||||
filterRow: {
|
||||
visible: true
|
||||
},
|
||||
searchPanel: {
|
||||
visible: true
|
||||
},
|
||||
paging: {
|
||||
pageSize: 20
|
||||
},
|
||||
pager: {
|
||||
showPageSizeSelector: true,
|
||||
allowedPageSizes: [10, 20, 50, 100]
|
||||
},
|
||||
editing: {
|
||||
mode: "popup",
|
||||
allowUpdating: true,
|
||||
allowAdding: true,
|
||||
allowDeleting: true
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Field Types
|
||||
|
||||
Supported field types in `relationDatas`:
|
||||
|
||||
```php
|
||||
$relationDatas = [
|
||||
'text_field' => ['type' => 'text'],
|
||||
'date_field' => ['type' => 'date'],
|
||||
'number_field' => ['type' => 'number'],
|
||||
'select_field' => [
|
||||
'type' => 'select',
|
||||
'datas' => ['option1' => 'Label 1', 'option2' => 'Label 2']
|
||||
],
|
||||
'link_field' => [
|
||||
'type' => 'link-search',
|
||||
'html' => '<i class="fa fa-link"></i>'
|
||||
],
|
||||
'decimal_field' => ['type' => 'decimal'],
|
||||
'checkbox_field' => ['type' => 'checkbox']
|
||||
];
|
||||
```
|
||||
|
||||
### Custom Validation
|
||||
|
||||
Add custom validation in `components/table/datagrid/validation-callback/{module}/{field}.blade.php`:
|
||||
|
||||
```javascript
|
||||
function validationCallback_fieldName(e) {
|
||||
// Custom validation logic
|
||||
if (e.value && e.value.length < 3) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
## Admin-AJAX System
|
||||
|
||||
### Creating AJAX Endpoints
|
||||
|
||||
1. **Create AJAX View**:
|
||||
```php
|
||||
// resources/views/admin-ajax/custom-action.blade.php
|
||||
@php
|
||||
$data = db('table_name')->where('condition', $request->input('value'))->get();
|
||||
echo json_encode([
|
||||
'status' => 'success',
|
||||
'data' => $data
|
||||
]);
|
||||
@endphp
|
||||
```
|
||||
|
||||
2. **Call from JavaScript**:
|
||||
```javascript
|
||||
$.ajax({
|
||||
url: '/admin-ajax/custom-action',
|
||||
type: 'POST',
|
||||
data: {
|
||||
value: 'search_value',
|
||||
_token: csrf_token
|
||||
},
|
||||
success: function(response) {
|
||||
// Handle response
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Common AJAX Patterns
|
||||
|
||||
#### Batch Operations
|
||||
```php
|
||||
// admin-ajax/batch-operation.blade.php
|
||||
@php
|
||||
$ids = $request->input('ids', []);
|
||||
$operation = $request->input('operation');
|
||||
|
||||
foreach($ids as $id) {
|
||||
db('table_name')->where('id', $id)->update(['status' => $operation]);
|
||||
}
|
||||
|
||||
echo json_encode(['status' => 'success', 'processed' => count($ids)]);
|
||||
@endphp
|
||||
```
|
||||
|
||||
#### Data Export
|
||||
```php
|
||||
// admin-ajax/export-data.blade.php
|
||||
@php
|
||||
$query = $request->input('query');
|
||||
$data = DB::select($query);
|
||||
|
||||
$filename = 'export_' . date('Y-m-d_H-i-s') . '.xlsx';
|
||||
Excel::store(new ExportExcel($data), $filename);
|
||||
|
||||
echo json_encode(['status' => 'success', 'file' => $filename]);
|
||||
@endphp
|
||||
```
|
||||
|
||||
## Save Trigger System
|
||||
|
||||
### Overview
|
||||
|
||||
Save triggers automatically process data changes and maintain data consistency across related tables.
|
||||
|
||||
### Trigger Structure
|
||||
|
||||
```php
|
||||
// app/Http/Controllers/SaveTrigger/{table_name}.php
|
||||
<?php
|
||||
use App\Models\RelatedModel;
|
||||
|
||||
$id = $request['key'];
|
||||
$data = db($tableName)->where("id", $id)->first();
|
||||
|
||||
// Detect changed fields
|
||||
$changedFields = [];
|
||||
foreach ($data as $key => $value) {
|
||||
if (isset($beforeData->$key) && $beforeData->$key != $value) {
|
||||
$changedFields[] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute related updates
|
||||
if (in_array('status', $changedFields)) {
|
||||
// Update related records
|
||||
RelatedModel::where('parent_id', $id)
|
||||
->update(['status' => $data->status]);
|
||||
}
|
||||
```
|
||||
|
||||
### Common Trigger Patterns
|
||||
|
||||
#### Status Synchronization
|
||||
```php
|
||||
// Update related records when status changes
|
||||
if (in_array('status', $changedFields)) {
|
||||
$newStatus = $data->status;
|
||||
|
||||
// Update child records
|
||||
db('child_table')->where('parent_id', $id)
|
||||
->update(['status' => $newStatus]);
|
||||
|
||||
// Update summary tables
|
||||
$summary = db('summary_table')->where('parent_id', $id)->first();
|
||||
if ($summary) {
|
||||
$summary->update(['last_status' => $newStatus]);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Calculated Fields
|
||||
```php
|
||||
// Recalculate totals when related fields change
|
||||
if (array_intersect(['quantity', 'unit_price'], $changedFields)) {
|
||||
$total = $data->quantity * $data->unit_price;
|
||||
|
||||
db($tableName)->where('id', $id)
|
||||
->update(['total' => $total]);
|
||||
}
|
||||
```
|
||||
|
||||
#### Cross-Table Updates
|
||||
```php
|
||||
// Update related tables when key fields change
|
||||
if (in_array('project_id', $changedFields)) {
|
||||
$newProjectId = $data->project_id;
|
||||
|
||||
// Update all related records
|
||||
db('related_table')->where('parent_id', $id)
|
||||
->update(['project_id' => $newProjectId]);
|
||||
}
|
||||
```
|
||||
|
||||
## Batch Excel Operations
|
||||
|
||||
### Import Process
|
||||
|
||||
1. **File Upload**: Users upload Excel files through the interface
|
||||
2. **Validation**: System validates data format and required fields
|
||||
3. **Processing**: Data is processed in batches to handle large files
|
||||
4. **Save Triggers**: Each row triggers the appropriate save triggers
|
||||
5. **Progress Tracking**: Real-time progress updates via AJAX
|
||||
|
||||
### Export Process
|
||||
|
||||
1. **Query Building**: Dynamic SQL query based on filters
|
||||
2. **Data Retrieval**: Fetch data with pagination for large datasets
|
||||
3. **Formatting**: Apply formatting and styling
|
||||
4. **File Generation**: Create Excel file with multiple sheets if needed
|
||||
5. **Download**: Provide download link to user
|
||||
|
||||
### Implementation Example
|
||||
|
||||
```php
|
||||
// Batch Excel Import
|
||||
public function importExcel(Request $request, string $tableName) {
|
||||
$file = $request->file('file');
|
||||
$import = new ImportExcel($tableName);
|
||||
|
||||
Excel::import($import, $file);
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'imported' => $import->getRowCount()
|
||||
]);
|
||||
}
|
||||
|
||||
// Batch Excel Export
|
||||
public function exportExcel(Request $request, string $tableName, string $fileName = "") {
|
||||
$query = $request->input('query');
|
||||
$data = DB::select($query);
|
||||
|
||||
$fileName = $fileName ?: $tableName . '_' . date('Y-m-d_H-i-s');
|
||||
|
||||
return Excel::download(new ExportExcel($data), $fileName . '.xlsx');
|
||||
}
|
||||
```
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### 1. Environment Setup
|
||||
|
||||
```bash
|
||||
# Clone repository
|
||||
git clone [repository-url]
|
||||
cd dev
|
||||
|
||||
# Install dependencies
|
||||
composer install
|
||||
npm install
|
||||
|
||||
# Configure environment
|
||||
cp .env.example .env
|
||||
php artisan key:generate
|
||||
|
||||
# Run migrations
|
||||
php artisan migrate
|
||||
|
||||
# Start development server
|
||||
php artisan serve
|
||||
```
|
||||
|
||||
### 2. Creating New Features
|
||||
|
||||
1. **Database Changes**:
|
||||
```bash
|
||||
php artisan make:migration create_new_table
|
||||
php artisan migrate
|
||||
```
|
||||
|
||||
2. **Model Creation**:
|
||||
```bash
|
||||
php artisan make:model NewModel
|
||||
```
|
||||
|
||||
3. **View Template**:
|
||||
- Copy `sablon4.blade.php` as base
|
||||
- Customize variables and field groups
|
||||
- Add to Types table
|
||||
|
||||
4. **Save Triggers** (if needed):
|
||||
- Create trigger file in `SaveTrigger/`
|
||||
- Define change detection logic
|
||||
- Implement cross-table updates
|
||||
|
||||
### 3. Testing
|
||||
|
||||
```bash
|
||||
# Run tests
|
||||
php artisan test
|
||||
|
||||
# Test specific module
|
||||
php artisan test --filter=NewModuleTest
|
||||
```
|
||||
|
||||
### 4. Deployment
|
||||
|
||||
```bash
|
||||
# Production deployment
|
||||
composer install --optimize-autoloader --no-dev
|
||||
php artisan config:cache
|
||||
php artisan route:cache
|
||||
php artisan view:cache
|
||||
```
|
||||
|
||||
## Common Patterns
|
||||
|
||||
### 1. Dynamic Field Handling
|
||||
|
||||
```php
|
||||
// Get field types from database
|
||||
$fieldTypes = [];
|
||||
foreach($columns as $column) {
|
||||
$fieldTypes[$column] = table_column_type($tableName, $column);
|
||||
}
|
||||
|
||||
// Apply custom field types
|
||||
$relationDatas = [
|
||||
'status' => ['type' => 'select', 'datas' => $statusOptions],
|
||||
'date_field' => ['type' => 'date'],
|
||||
];
|
||||
```
|
||||
|
||||
### 2. Permission Checking
|
||||
|
||||
```php
|
||||
// Check user permissions
|
||||
if (!isAuth($tableName, 'write')) {
|
||||
return response()->json(['error' => 'Permission denied'], 403);
|
||||
}
|
||||
|
||||
// Role-based access
|
||||
if (!isAdmin()) {
|
||||
// Limited access logic
|
||||
}
|
||||
```
|
||||
|
||||
### 3. Data Validation
|
||||
|
||||
```php
|
||||
// Custom validation in save triggers
|
||||
$requiredFields = ['name', 'email', 'status'];
|
||||
foreach($requiredFields as $field) {
|
||||
if (empty($data->$field)) {
|
||||
throw new Exception("Field $field is required");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 4. Error Handling
|
||||
|
||||
```php
|
||||
try {
|
||||
// Database operation
|
||||
DB::transaction(function() use ($data) {
|
||||
// Complex operations
|
||||
});
|
||||
} catch (Exception $e) {
|
||||
Log::error('Operation failed', [
|
||||
'error' => $e->getMessage(),
|
||||
'data' => $data
|
||||
]);
|
||||
|
||||
return response()->json(['error' => 'Operation failed'], 500);
|
||||
}
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
1. **DataGrid Not Loading**:
|
||||
- Check browser console for JavaScript errors
|
||||
- Verify AJAX endpoint returns valid JSON
|
||||
- Check network tab for failed requests
|
||||
|
||||
2. **Save Triggers Not Working**:
|
||||
- Verify trigger file exists in `SaveTrigger/`
|
||||
- Check database permissions
|
||||
- Review error logs
|
||||
|
||||
3. **Excel Import Failures**:
|
||||
- Validate Excel file format
|
||||
- Check column mappings
|
||||
- Verify required fields are present
|
||||
|
||||
4. **Permission Errors**:
|
||||
- Check user level in database
|
||||
- Verify module permissions
|
||||
- Review middleware configuration
|
||||
|
||||
### Debug Tools
|
||||
|
||||
1. **Laravel Telescope** (if enabled):
|
||||
```
|
||||
/telescope
|
||||
```
|
||||
|
||||
2. **Database Logging**:
|
||||
```php
|
||||
DB::enableQueryLog();
|
||||
// ... operations
|
||||
dd(DB::getQueryLog());
|
||||
```
|
||||
|
||||
3. **DevExtreme Debug**:
|
||||
```javascript
|
||||
// Enable DevExtreme debug mode
|
||||
DevExpress.config({ debug: true });
|
||||
```
|
||||
|
||||
### Performance Optimization
|
||||
|
||||
1. **Database Indexing**:
|
||||
```sql
|
||||
CREATE INDEX idx_table_column ON table_name(column_name);
|
||||
```
|
||||
|
||||
2. **Query Optimization**:
|
||||
```php
|
||||
// Use eager loading for relationships
|
||||
$data = Model::with('relation')->get();
|
||||
```
|
||||
|
||||
3. **Caching**:
|
||||
```php
|
||||
// Cache frequently accessed data
|
||||
$data = Cache::remember('key', 3600, function() {
|
||||
return Model::all();
|
||||
});
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
This guide provides a comprehensive overview of the DevQMS system. For specific module documentation, refer to the individual guide files in the `guide/` directory. Always test changes in a development environment before deploying to production.
|
||||
@@ -1,255 +0,0 @@
|
||||
# Document History User Guide
|
||||
|
||||
## What is Document History?
|
||||
|
||||
Document History is a tracking system that keeps a complete record of what happens to your PDF files and documents. It's like a logbook that shows who uploaded, moved, downloaded, or archived any document in the system, along with when these actions happened.
|
||||
|
||||
## Why is Document History Important?
|
||||
|
||||
### Quality Control Benefits
|
||||
- **Track Changes**: See exactly when a document was updated
|
||||
- **Audit Trail**: Full record of who did what and when
|
||||
- **Version Control**: Know which version of a document was active at any time
|
||||
- **Compliance**: Meet regulatory requirements for document tracking
|
||||
|
||||
### Practical Benefits
|
||||
- **Find Lost Files**: Locate documents that were moved or archived
|
||||
- **Accountability**: Know who made changes to critical documents
|
||||
- **Recovery**: Retrieve older versions if needed
|
||||
- **Planning**: Understand document update patterns
|
||||
|
||||
## How to Access Document History
|
||||
|
||||
### From Data Tables
|
||||
1. **Find a PDF column** in any data table (reports, test results, etc.)
|
||||
2. **Right-click** on any cell in that column
|
||||
3. Look for the **"📋 Document History"** option in the menu
|
||||
4. **Click** on it to open the history window
|
||||
|
||||
### What Columns Show History?
|
||||
The system automatically detects PDF-related columns:
|
||||
- Columns with "download" in the name
|
||||
- Columns with "file" in the name
|
||||
- Columns with "pdf" in the name
|
||||
- Columns with "document" in the name
|
||||
- Columns with "report" in the name
|
||||
- Technology certificate columns
|
||||
|
||||
## Understanding the History Display
|
||||
|
||||
### The History Table
|
||||
When you open Document History, you'll see a table with these columns:
|
||||
|
||||
**ID**: Unique record number for each action
|
||||
|
||||
**User**: Name of the person who performed the action
|
||||
|
||||
**Action**: What was done to the file:
|
||||
- 🟢 **Upload**: New file was added to the system
|
||||
- 🔵 **Download**: Someone downloaded the file
|
||||
- 🟡 **Archive**: File was moved to archive storage
|
||||
- 🔴 **Delete**: File was removed from the system
|
||||
|
||||
**File Name**: The actual name of the document
|
||||
|
||||
**Size**: How large the file is (in KB or MB)
|
||||
|
||||
**From**: Where the file was moved from (if applicable)
|
||||
|
||||
**To**: Where the file was moved to (if applicable)
|
||||
|
||||
**Date & Time**: Exactly when the action occurred
|
||||
|
||||
**Notes**: Additional information about what happened
|
||||
|
||||
**Actions**: Buttons to view or download the file
|
||||
|
||||
### Example History Records
|
||||
```
|
||||
User: John Smith
|
||||
Action: Upload (🟢)
|
||||
File: WPS-001-Rev02.pdf
|
||||
Date: 15/01/2025 14:30
|
||||
Notes: New file uploaded to server
|
||||
|
||||
User: Jane Doe
|
||||
Action: Archive (🟡)
|
||||
File: WPS-001-Rev01.pdf
|
||||
Date: 15/01/2025 14:31
|
||||
Notes: File replaced with new version and archived
|
||||
```
|
||||
|
||||
## Using the Action Buttons
|
||||
|
||||
### View Button (👁️)
|
||||
- **Purpose**: Look at the document without downloading it
|
||||
- **How it works**: Opens the PDF in a popup window
|
||||
- **When to use**: Quick review, checking content, verification
|
||||
|
||||
### Download Button (⬇️)
|
||||
- **Purpose**: Save a copy of the file to your computer
|
||||
- **How it works**: Starts automatic download
|
||||
- **When to use**: Need to work with the file offline, share with others
|
||||
|
||||
## Common Use Cases
|
||||
|
||||
### Finding the Latest Version
|
||||
**Problem**: "I need the most recent version of this drawing"
|
||||
**Solution**:
|
||||
1. Open Document History for that drawing column
|
||||
2. Look at the top record (most recent)
|
||||
3. Check if it's an "Upload" action
|
||||
4. Use the View or Download button
|
||||
|
||||
### Recovering Archived Files
|
||||
**Problem**: "A file disappeared from the system"
|
||||
**Solution**:
|
||||
1. Open Document History for that location
|
||||
2. Look for "Archive" actions
|
||||
3. Find the archived file in the history
|
||||
4. Use Download button to get the file back
|
||||
|
||||
### Audit Trail
|
||||
**Problem**: "Who updated this document last month?"
|
||||
**Solution**:
|
||||
1. Open Document History
|
||||
2. Look at the Date & Time column
|
||||
3. Find actions from last month
|
||||
4. Check the User column to see who made changes
|
||||
|
||||
### Version Comparison
|
||||
**Problem**: "What changed between versions?"
|
||||
**Solution**:
|
||||
1. Open Document History
|
||||
2. Find both versions you want to compare
|
||||
3. Download both using the Download buttons
|
||||
4. Compare them offline
|
||||
|
||||
## Understanding File Movement
|
||||
|
||||
### Upload Process
|
||||
When someone uploads a new file:
|
||||
1. **New File**: Creates an "Upload" record
|
||||
2. **Existing File**:
|
||||
- Old file gets "Archive" record
|
||||
- New file gets "Upload" record
|
||||
- Old file moved to Archive folder with timestamp
|
||||
|
||||
### Archive Structure
|
||||
Archived files are organized like this:
|
||||
```
|
||||
Archive/
|
||||
├── Original_Folder/
|
||||
│ └── File_Name_Folder/
|
||||
│ ├── file_name_2025_01_15_14_30_25.pdf
|
||||
│ └── file_name_2025_01_16_09_15_42.pdf
|
||||
```
|
||||
|
||||
## Search and Filter Features
|
||||
|
||||
### Built-in Search
|
||||
- **Search Box**: Type any text to find matching records
|
||||
- **Column Filters**: Click column headers to filter by specific values
|
||||
- **Date Filters**: Filter by date ranges
|
||||
|
||||
### Search Tips
|
||||
- Search by **file name** to find all versions
|
||||
- Search by **user name** to see someone's activities
|
||||
- Search by **action type** to see only uploads or downloads
|
||||
- Use **date filters** to focus on specific time periods
|
||||
|
||||
## Best Practices
|
||||
|
||||
### For Regular Users
|
||||
1. **Check History First**: Before asking "where's my file?", check the history
|
||||
2. **Use Proper Names**: When uploading, use clear, descriptive file names
|
||||
3. **Add Notes**: Some systems allow adding notes - use them to explain changes
|
||||
|
||||
### For Supervisors
|
||||
1. **Regular Reviews**: Check document history during audits
|
||||
2. **Monitor Activity**: Look for unusual patterns or missing updates
|
||||
3. **Version Control**: Ensure old versions are properly archived
|
||||
|
||||
### For Quality Managers
|
||||
1. **Audit Compliance**: Use history records for regulatory compliance
|
||||
2. **Change Control**: Track document revision processes
|
||||
3. **Training Records**: Monitor who accesses which documents
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "No History Found"
|
||||
**Possible Causes**:
|
||||
- File was never uploaded through the system
|
||||
- Looking at wrong column/location
|
||||
- File was uploaded before history tracking started
|
||||
|
||||
**Solutions**:
|
||||
- Check other related columns
|
||||
- Contact system administrator
|
||||
- Look for manual records
|
||||
|
||||
### "Download Not Working"
|
||||
**Possible Causes**:
|
||||
- File was moved or deleted from storage
|
||||
- Network connectivity issues
|
||||
- Browser blocking downloads
|
||||
|
||||
**Solutions**:
|
||||
- Try different browser
|
||||
- Check internet connection
|
||||
- Contact IT support
|
||||
|
||||
### "History Shows Wrong Information"
|
||||
**Possible Causes**:
|
||||
- System time settings incorrect
|
||||
- User account mixup
|
||||
- Data entry error
|
||||
|
||||
**Solutions**:
|
||||
- Report to system administrator
|
||||
- Cross-check with other records
|
||||
- Document the discrepancy
|
||||
|
||||
## Security and Permissions
|
||||
|
||||
### Who Can See History?
|
||||
- **Read Permission**: View document history
|
||||
- **Full Control**: View history + perform actions
|
||||
- **Admin**: All access + system management
|
||||
|
||||
### Data Privacy
|
||||
- All actions are logged with user identification
|
||||
- Timestamps are permanent and cannot be changed
|
||||
- History records are kept for audit purposes
|
||||
|
||||
## Getting Help
|
||||
|
||||
### When to Contact Support
|
||||
- History showing incorrect information
|
||||
- Unable to download archived files
|
||||
- Need help understanding specific records
|
||||
- System not tracking actions properly
|
||||
|
||||
### What Information to Provide
|
||||
- Specific file name or document
|
||||
- Date range of the issue
|
||||
- What you were trying to do
|
||||
- Any error messages received
|
||||
|
||||
## Tips for Efficiency
|
||||
|
||||
### Quick Actions
|
||||
- **Right-click directly** on file cells for instant history
|
||||
- **Use search** instead of scrolling through long lists
|
||||
- **Bookmark important** document locations
|
||||
|
||||
### Regular Monitoring
|
||||
- **Weekly reviews** of important document areas
|
||||
- **Monthly audits** of archive activities
|
||||
- **Quarterly reports** on document update patterns
|
||||
|
||||
## Summary
|
||||
|
||||
Document History provides complete transparency into your document management system. By tracking every upload, download, archive, and deletion, it ensures you always know what happened to your files and when. Use it regularly to maintain control over your documentation and meet quality compliance requirements.
|
||||
|
||||
Remember: Document History is not just a record-keeping tool - it's your safety net for document management and a powerful tool for maintaining quality control in your projects.
|
||||
@@ -1,75 +0,0 @@
|
||||
# Document Manager v2 User Guide
|
||||
|
||||
## What is the Document Manager v2 Module?
|
||||
|
||||
Document Manager v2 is the enhanced version of the document management system with advanced features including improved search capabilities, better collaboration tools, and enhanced security features. This module provides a more robust and user-friendly document management experience.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Document Manager v2:
|
||||
1. Login to the system
|
||||
2. Click on **Settings** in the main menu
|
||||
3. Select **Document Manager v2** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Advanced Search**: Enhanced search with filters and saved searches
|
||||
- **Collaboration Tools**: Real-time collaboration and commenting
|
||||
- **Enhanced Security**: Advanced access control and encryption
|
||||
- **Workflow Management**: Automated document workflows and approvals
|
||||
|
||||
### Secondary Functions
|
||||
- **Document Analytics**: Track document usage and access patterns
|
||||
- **Integration**: Better integration with other system modules
|
||||
- **Mobile Access**: Mobile-friendly interface for document access
|
||||
- **Advanced Reporting**: Comprehensive document management reports
|
||||
|
||||
## How to Use
|
||||
|
||||
### Advanced Document Search
|
||||
1. Use the advanced search interface
|
||||
2. Apply multiple filters (date, category, author, etc.)
|
||||
3. Save frequently used searches
|
||||
4. Use full-text search capabilities
|
||||
5. Export search results
|
||||
|
||||
### Collaboration Features
|
||||
1. Add comments to documents
|
||||
2. Share documents with team members
|
||||
3. Track document changes and versions
|
||||
4. Set up automated notifications
|
||||
5. Use real-time collaboration tools
|
||||
|
||||
### Document Workflows
|
||||
1. Create custom approval workflows
|
||||
2. Assign document reviewers
|
||||
3. Track approval status
|
||||
4. Set up automated reminders
|
||||
5. Generate workflow reports
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Use advanced search features for efficient document retrieval
|
||||
- ✅ Utilize collaboration tools for team communication
|
||||
- ✅ Set up appropriate workflows for document approval
|
||||
- ✅ Regular review of document access permissions
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify document integrity and version control
|
||||
- ✅ Monitor document access and usage patterns
|
||||
- ✅ Regular backup and security audits
|
||||
- ✅ Update document metadata regularly
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Search not working**: Check search filters and keywords
|
||||
2. **Collaboration features unavailable**: Verify user permissions
|
||||
3. **Workflow stuck**: Contact workflow administrator
|
||||
|
||||
### Getting Help
|
||||
- Contact the IT department for technical support
|
||||
- Consult the advanced user manual
|
||||
- Check system status and maintenance schedules
|
||||
@@ -1,76 +0,0 @@
|
||||
# Document Manager User Guide
|
||||
|
||||
## What is the Document Manager Module?
|
||||
|
||||
The Document Manager module provides comprehensive document management capabilities for organizing, storing, and retrieving project documents. This module helps manage document versions, control access, and ensure proper document organization and retrieval.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Document Manager:
|
||||
1. Login to the system
|
||||
2. Click on **Documentation** in the main menu
|
||||
3. Select **Document Manager** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Document Storage**: Store and organize project documents
|
||||
- **Version Control**: Manage document versions and revisions
|
||||
- **Access Control**: Control document access and permissions
|
||||
- **Search and Retrieval**: Search and retrieve documents efficiently
|
||||
|
||||
### Secondary Functions
|
||||
- **Document Classification**: Classify and categorize documents
|
||||
- **Workflow Management**: Manage document workflows
|
||||
- **Report Generation**: Generate document reports
|
||||
- **Backup and Recovery**: Backup and recover documents
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing Documents
|
||||
1. Click **"Manage Documents"** button
|
||||
2. Select document for management
|
||||
3. Upload or update document
|
||||
4. Set document properties
|
||||
5. Assign access permissions
|
||||
6. Organize document structure
|
||||
7. Generate document reports
|
||||
|
||||
### Document Management
|
||||
1. Review document structure
|
||||
2. Upload and organize documents
|
||||
3. Manage document versions
|
||||
4. Control access permissions
|
||||
5. Generate document reports
|
||||
|
||||
### Document Categories
|
||||
- **Project Documents**: Project-related documents
|
||||
- **Technical Documents**: Technical specifications
|
||||
- **Quality Documents**: Quality control documents
|
||||
- **Administrative Documents**: Administrative documents
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Organize documents systematically
|
||||
- ✅ Maintain proper version control
|
||||
- ✅ Set appropriate access permissions
|
||||
- ✅ Regular backup of documents
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify document accuracy and completeness
|
||||
- ✅ Ensure proper document organization
|
||||
- ✅ Monitor document management effectiveness
|
||||
- ✅ Regular review of document processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Document not uploading**: Check file size and format
|
||||
2. **Access denied**: Verify user permissions
|
||||
3. **Search not working**: Check search criteria and indexing
|
||||
|
||||
### Getting Help
|
||||
- Contact the Documentation department for technical support
|
||||
- Consult document manager procedures and guidelines
|
||||
- Check document access and system status
|
||||
@@ -1,76 +0,0 @@
|
||||
# Document Procedure User Guide
|
||||
|
||||
## What is the Document Procedure Module?
|
||||
|
||||
The Document Procedure module manages and maintains document procedures and workflows. This module helps establish document procedures, track procedure compliance, and ensure proper document management processes.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Document Procedure:
|
||||
1. Login to the system
|
||||
2. Click on **QA** in the main menu
|
||||
3. Select **Document Procedure** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Procedure Management**: Manage document procedures
|
||||
- **Workflow Control**: Control document workflows
|
||||
- **Compliance Monitoring**: Monitor procedure compliance
|
||||
- **Documentation**: Maintain procedure documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate procedure reports
|
||||
- **Version Control**: Manage procedure versions
|
||||
- **Approval Workflow**: Manage procedure approvals
|
||||
- **Training Management**: Manage procedure training
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing Document Procedures
|
||||
1. Click **"Manage Procedures"** button
|
||||
2. Select procedure for management
|
||||
3. Review procedure content and workflow
|
||||
4. Update procedure information
|
||||
5. Set approval workflow
|
||||
6. Manage procedure versions
|
||||
7. Track procedure compliance
|
||||
|
||||
### Procedure Management
|
||||
1. Review document procedures
|
||||
2. Update procedure content and workflow
|
||||
3. Manage procedure versions
|
||||
4. Monitor procedure compliance
|
||||
5. Generate procedure reports
|
||||
|
||||
### Procedure Categories
|
||||
- **Document Procedures**: Document management procedures
|
||||
- **Quality Procedures**: Quality control procedures
|
||||
- **Safety Procedures**: Safety management procedures
|
||||
- **Administrative Procedures**: Administrative procedures
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Maintain clear and accurate procedures
|
||||
- ✅ Update procedures as needed
|
||||
- ✅ Monitor procedure compliance
|
||||
- ✅ Ensure proper procedure documentation
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify procedure accuracy and completeness
|
||||
- ✅ Ensure proper procedure workflow
|
||||
- ✅ Monitor procedure effectiveness
|
||||
- ✅ Regular review of procedure processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Procedure not saving**: Check all required fields are completed
|
||||
2. **Workflow errors**: Review procedure workflow and requirements
|
||||
3. **Compliance issues**: Verify procedure compliance requirements
|
||||
|
||||
### Getting Help
|
||||
- Contact the QA department for technical support
|
||||
- Consult document procedure guidelines and standards
|
||||
- Check procedure workflow and compliance requirements
|
||||
@@ -1,77 +0,0 @@
|
||||
# Document Revision User Guide
|
||||
|
||||
## What is the Document Revision Module?
|
||||
|
||||
The Document Revision module manages document revision control and tracks changes to project documents. This module helps maintain document version history, track modifications, and ensure proper approval processes for document changes.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Document Revision:
|
||||
1. Login to the system
|
||||
2. Click on **Manufacturing** in the main menu
|
||||
3. Select **Document Revision** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Revision Control**: Track document versions and changes
|
||||
- **Change Management**: Manage document modification requests
|
||||
- **Approval Workflow**: Control revision approval processes
|
||||
- **Version History**: Maintain complete revision history
|
||||
|
||||
### Secondary Functions
|
||||
- **Change Tracking**: Track who made changes and when
|
||||
- **Document Comparison**: Compare different document versions
|
||||
- **Rollback Capability**: Revert to previous document versions
|
||||
- **Notification System**: Alert stakeholders about document changes
|
||||
|
||||
## How to Use
|
||||
|
||||
### Creating Document Revisions
|
||||
1. Select the document to revise
|
||||
2. Click **"Create Revision"** button
|
||||
3. Make necessary changes to the document
|
||||
4. Add revision notes and justification
|
||||
5. Submit for approval
|
||||
6. Track approval status
|
||||
7. Publish approved revision
|
||||
|
||||
### Revision Approval Process
|
||||
1. Review revision request and changes
|
||||
2. Verify revision justification
|
||||
3. Check impact on related documents
|
||||
4. Approve or reject revision
|
||||
5. Document decision and comments
|
||||
6. Update document version
|
||||
|
||||
### Revision Categories
|
||||
- **Minor Revisions**: Small corrections and updates
|
||||
- **Major Revisions**: Significant changes requiring review
|
||||
- **Emergency Revisions**: Urgent changes for safety or compliance
|
||||
- **Standard Revisions**: Regular updates and improvements
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Always document reasons for revision
|
||||
- ✅ Follow proper approval workflow
|
||||
- ✅ Check impact on related documents
|
||||
- ✅ Maintain revision history and notes
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify revision accuracy and completeness
|
||||
- ✅ Ensure proper approval before publishing
|
||||
- ✅ Update related documents if necessary
|
||||
- ✅ Notify affected personnel about changes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Cannot create revision**: Check document permissions and status
|
||||
2. **Approval workflow stuck**: Contact the document administrator
|
||||
3. **Revision not publishing**: Verify approval status and workflow
|
||||
|
||||
### Getting Help
|
||||
- Contact the Manufacturing department for technical support
|
||||
- Consult document revision procedures
|
||||
- Check revision history and approval status
|
||||
@@ -1,76 +0,0 @@
|
||||
# Document Templates User Guide
|
||||
|
||||
## What is the Document Templates Module?
|
||||
|
||||
The Document Templates module manages pre-built document templates for various project needs. This module helps create standardized documents, maintain template consistency, and ensure proper document formatting and structure.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Document Templates:
|
||||
1. Login to the system
|
||||
2. Click on **Settings** in the main menu
|
||||
3. Select **Document Templates** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Template Management**: Manage document templates
|
||||
- **Template Creation**: Create new document templates
|
||||
- **Standardization**: Standardize document formats
|
||||
- **Customization**: Customize template content
|
||||
|
||||
### Secondary Functions
|
||||
- **Version Control**: Manage template versions
|
||||
- **Distribution**: Distribute templates to users
|
||||
- **Report Generation**: Generate template reports
|
||||
- **Access Control**: Control template access
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing Templates
|
||||
1. Click **"Manage Templates"** button
|
||||
2. Select template for management
|
||||
3. Review template content
|
||||
4. Update template information
|
||||
5. Set access permissions
|
||||
6. Distribute templates
|
||||
7. Generate template reports
|
||||
|
||||
### Template Management
|
||||
1. Review document templates
|
||||
2. Create new templates
|
||||
3. Update existing templates
|
||||
4. Manage template versions
|
||||
5. Distribute templates
|
||||
|
||||
### Template Categories
|
||||
- **Standard Templates**: Standard document templates
|
||||
- **Custom Templates**: User-defined templates
|
||||
- **Form Templates**: Form and questionnaire templates
|
||||
- **Report Templates**: Report format templates
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Use standardized templates
|
||||
- ✅ Maintain template consistency
|
||||
- ✅ Update templates as needed
|
||||
- ✅ Ensure proper template distribution
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify template accuracy and completeness
|
||||
- ✅ Ensure proper template formatting
|
||||
- ✅ Monitor template usage effectiveness
|
||||
- ✅ Regular review of template processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Template not saving**: Check all required fields are completed
|
||||
2. **Formatting issues**: Review template design and formatting
|
||||
3. **Distribution problems**: Verify user permissions and access
|
||||
|
||||
### Getting Help
|
||||
- Contact the Settings department for technical support
|
||||
- Consult document templates procedures and guidelines
|
||||
- Check template access and system status
|
||||
@@ -1,74 +0,0 @@
|
||||
# Documentation User Guide
|
||||
|
||||
## What is the Documentation Module?
|
||||
|
||||
The Documentation module serves as the central hub for all project documentation activities. This module provides access to various documentation tools, manages documentation workflows, and ensures proper documentation standards across the project.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Documentation:
|
||||
1. Login to the system
|
||||
2. Click on **Documentation** in the main menu
|
||||
3. Access various documentation tools and features
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Documentation Hub**: Central access to all documentation tools
|
||||
- **Documentation Standards**: Maintain consistent documentation standards
|
||||
- **Workflow Management**: Manage documentation creation and approval
|
||||
- **Quality Control**: Ensure documentation quality and completeness
|
||||
|
||||
### Secondary Functions
|
||||
- **Documentation Training**: Access documentation training materials
|
||||
- **Best Practices**: Guidelines for effective documentation
|
||||
- **Compliance Tracking**: Ensure documentation meets regulatory requirements
|
||||
- **Reporting**: Generate documentation status reports
|
||||
|
||||
## How to Use
|
||||
|
||||
### Documentation Workflow
|
||||
1. Identify documentation requirements
|
||||
2. Choose appropriate documentation tool
|
||||
3. Create or update documents
|
||||
4. Follow approval workflow
|
||||
5. Publish and distribute documents
|
||||
6. Maintain document version control
|
||||
|
||||
### Documentation Categories
|
||||
- **Technical Documentation**: Engineering and technical documents
|
||||
- **Quality Documentation**: Quality control and inspection documents
|
||||
- **Safety Documentation**: Safety procedures and incident reports
|
||||
- **Administrative Documentation**: Administrative and management documents
|
||||
|
||||
### Documentation Standards
|
||||
- **Format Standards**: Consistent document formatting
|
||||
- **Content Standards**: Quality and completeness requirements
|
||||
- **Approval Standards**: Required approvals and workflows
|
||||
- **Distribution Standards**: Document distribution procedures
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Follow established documentation standards
|
||||
- ✅ Use appropriate documentation tools for each task
|
||||
- ✅ Maintain document version control
|
||||
- ✅ Ensure proper approval and distribution
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify document accuracy and completeness
|
||||
- ✅ Check document formatting and structure
|
||||
- ✅ Ensure compliance with regulatory requirements
|
||||
- ✅ Regular review and update of documentation
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Cannot access documentation tools**: Check user permissions
|
||||
2. **Documentation workflow stuck**: Contact documentation administrator
|
||||
3. **Quality issues**: Review documentation standards and procedures
|
||||
|
||||
### Getting Help
|
||||
- Contact the Documentation department for technical support
|
||||
- Consult documentation standards and procedures
|
||||
- Check documentation training materials
|
||||
@@ -1,170 +0,0 @@
|
||||
# Dynamic Resource API Usage Guide / Dinamik Kaynak API Kullanım Kılavuzu
|
||||
|
||||
This guide details how to use the Dynamic Resource API endpoint (`/api/{table}/{action}`) and explains each parameter in depth.
|
||||
Bu kılavuz, Dinamik Kaynak API uç noktasının (`/api/{table}/{action}`) nasıl kullanılacağını ve her bir parametrenin ne işe yaradığını detaylandırır.
|
||||
|
||||
---
|
||||
|
||||
## 1. Endpoint Structure / Uç Nokta Yapısı
|
||||
|
||||
**URL:** `POST /api/{table}/{action}`
|
||||
(Also supports GET for read operations, but POST is recommended for complex filters)
|
||||
(Okuma işlemleri için GET de desteklenir ancak karmaşık filtreler için POST önerilir)
|
||||
|
||||
### Path Parameters / Yol Parametreleri
|
||||
|
||||
#### 1. `{table}`
|
||||
This parameter defines the target resource. It can be one of two things:
|
||||
Bu parametre hedef kaynağı tanımlar. İki şeyden biri olabilir:
|
||||
|
||||
* **Module Slug (Recommended / Önerilen):** e.g., `test-packages`, `weld-log`, `radiographic-test`.
|
||||
* **How it works:** The system looks up this slug in the `types` table.
|
||||
* **Security:** Checks module-based permissions (`isAuth`).
|
||||
* **Result:** Resolves to the actual database table defined in the module settings (e.g., `test-packages` -> `test_packages`).
|
||||
* **Nasıl çalışır:** Sistem bu kısa adı `types` tablosunda arar.
|
||||
* **Güvenlik:** Modül bazlı izinleri kontrol eder.
|
||||
* **Sonuç:** Modül ayarlarında tanımlı gerçek veritabanı tablosuna yönlenir.
|
||||
|
||||
* **Table Name (Direct / Direkt):** e.g., `users`, `logs`.
|
||||
* **How it works:** Accesses the database table directly.
|
||||
* **Security:** Requires standard API authentication (Bearer Token). Bypasses module permissions.
|
||||
* **Nasıl çalışır:** Veritabanı tablosuna doğrudan erişir.
|
||||
* **Güvenlik:** Standart API kimlik doğrulaması gerektirir. Modül izinlerini atlar.
|
||||
|
||||
#### 2. `{action}`
|
||||
Defines the operation to perform.
|
||||
Gerçekleştirilecek işlemi tanımlar.
|
||||
|
||||
| Action | HTTP Method Equivalent | Permission Required (Module) | Description / Açıklama |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `read`, `list`, `get` | GET | **read** | Fetch records. (Kayıtları getir) |
|
||||
| `create`, `store`, `insert` | POST | **write** | Create a new record. (Yeni kayıt oluştur) |
|
||||
| `update`, `save` | PUT/PATCH | **write** | Update an existing record. (Kayıt güncelle) |
|
||||
| `delete`, `remove` | DELETE | **full_control** | Delete a record. (Kayıt sil) |
|
||||
| `view`, `render` | GET | **read** | Render a server-side Blade view. (Blade şablonu render et) |
|
||||
|
||||
---
|
||||
|
||||
## 2. Body Parameters / Gövde Parametreleri
|
||||
|
||||
These parameters are sent in the JSON body of the request.
|
||||
Bu parametreler isteğin JSON gövdesinde gönderilir.
|
||||
|
||||
### `filter` (Array/JSON)
|
||||
Used for filtering data. Supports **DevExtreme** filter syntax.
|
||||
Veriyi filtrelemek için kullanılır. **DevExtreme** filtre sözdizimini destekler.
|
||||
|
||||
* **Simple Filter:** `["field", "operator", "value"]`
|
||||
* **Complex Filter:** `[["field1", "=", "value1"], "and", ["field2", ">", 10]]`
|
||||
* **Operators:** `=`, `<>`, `>`, `>=`, `<`, `<=`, `contains`, `notcontains`, `startswith`, `endswith`.
|
||||
|
||||
**Example / Örnek:**
|
||||
```json
|
||||
"filter": [
|
||||
["status", "=", "active"],
|
||||
"and",
|
||||
["created_at", ">", "2023-01-01"]
|
||||
]
|
||||
```
|
||||
|
||||
### `sort` (Array/JSON)
|
||||
Defines sorting order.
|
||||
Sıralama düzenini belirler.
|
||||
|
||||
**Example / Örnek:**
|
||||
```json
|
||||
"sort": [
|
||||
{ "selector": "created_at", "desc": true },
|
||||
{ "selector": "name", "desc": false }
|
||||
]
|
||||
```
|
||||
|
||||
### `skip` (Integer) & `take` (Integer)
|
||||
Used for pagination.
|
||||
Sayfalama için kullanılır.
|
||||
|
||||
* `skip`: How many records to skip (offset). (Kaç kayıt atlanacak)
|
||||
* `take`: How many records to return (limit). (Kaç kayıt getirilecek)
|
||||
|
||||
### `columns` (Array/String)
|
||||
Used to retrieve specific columns. If omitted or null, returns all columns (`*`).
|
||||
Belirli sütunları getirmek için kullanılır. Atlanırsa veya null ise tüm sütunları (`*`) döndürür.
|
||||
|
||||
* **Format:** JSON Array of strings or Comma-separated string.
|
||||
* **Format:** JSON String dizisi veya virgülle ayrılmış string.
|
||||
|
||||
**Example / Örnek:**
|
||||
```json
|
||||
"columns": ["id", "title", "status"]
|
||||
```
|
||||
**Or / Veya:**
|
||||
```json
|
||||
"columns": "id, title, status"
|
||||
```
|
||||
|
||||
### `data` (Object)
|
||||
**Required for:** `create`, `update`.
|
||||
Contains the fields and values to be saved.
|
||||
Kaydedilecek alanları ve değerleri içerir.
|
||||
|
||||
**Note:** The system automatically filters out fields that do not exist in the database table to prevent errors.
|
||||
**Not:** Sistem, veritabanı tablosunda olmayan alanları hataları önlemek için otomatik olarak filtreler.
|
||||
|
||||
**Example / Örnek:**
|
||||
```json
|
||||
"data": {
|
||||
"name": "Project X",
|
||||
"status": "pending",
|
||||
"budget": 5000
|
||||
}
|
||||
```
|
||||
|
||||
### `id` or `key` (Integer/String)
|
||||
**Required for:** `update`, `delete`.
|
||||
Identifier of the record to update or delete.
|
||||
Güncellenecek veya silinecek kaydın kimliği.
|
||||
|
||||
### `file` (String)
|
||||
**Required for:** `view`.
|
||||
The name of the Blade file to render (without `.blade.php`).
|
||||
Render edilecek Blade dosyasının adı (`.blade.php` olmadan).
|
||||
|
||||
* **Search Path 1:** `resources/views/admin/{table}/{file}.blade.php`
|
||||
* **Search Path 2:** `resources/views/admin/type/{table}/{file}.blade.php`
|
||||
|
||||
---
|
||||
|
||||
## 3. Example Scenarios / Örnek Senaryolar
|
||||
|
||||
### Scenario 1: Fetch Data with Filtering (Veri Çekme ve Filtreleme)
|
||||
**Request:** `POST /api/weld-log/read`
|
||||
```json
|
||||
{
|
||||
"filter": [["weld_no", "contains", "W-10"]],
|
||||
"sort": [{"selector": "id", "desc": true}],
|
||||
"take": 10
|
||||
}
|
||||
```
|
||||
|
||||
### Scenario 2: Update a Record (Kayıt Güncelleme)
|
||||
**Request:** `POST /api/users/update`
|
||||
```json
|
||||
{
|
||||
"id": 15,
|
||||
"data": {
|
||||
"email": "new@example.com",
|
||||
"status": "active"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Scenario 3: Render a Form View (Form Görünümü Render Etme)
|
||||
**Request:** `POST /api/test-packages/view`
|
||||
```json
|
||||
{
|
||||
"file": "form",
|
||||
"id": 5
|
||||
}
|
||||
```
|
||||
* **Looks for:** `admin.type.test_packages.form` or `admin.test_packages.form` view.
|
||||
* **Returns:** HTML content of the form.
|
||||
@@ -1,76 +0,0 @@
|
||||
# Employees Main User Guide
|
||||
|
||||
## What is the Employees Main Module?
|
||||
|
||||
The Employees Main module is the primary employee management system for main project personnel. This module manages employee information, qualifications, assignments, and project participation for the main project workforce.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Employees Main:
|
||||
1. Login to the system
|
||||
2. Click on **Main-Employees** in the main menu
|
||||
3. Access employee management features
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Employee Database**: Comprehensive employee information management
|
||||
- **Qualification Tracking**: Track employee qualifications and certifications
|
||||
- **Assignment Management**: Manage employee project assignments
|
||||
- **Performance Monitoring**: Monitor employee performance and productivity
|
||||
|
||||
### Secondary Functions
|
||||
- **Training Records**: Track employee training and development
|
||||
- **Document Management**: Manage employee-related documents
|
||||
- **Reporting**: Generate employee reports and analytics
|
||||
- **Compliance Tracking**: Ensure compliance with labor regulations
|
||||
|
||||
## How to Use
|
||||
|
||||
### Employee Registration
|
||||
1. Click **"Add New Employee"** button
|
||||
2. Enter personal information and contact details
|
||||
3. Add qualifications and certifications
|
||||
4. Set employment status and type
|
||||
5. Assign to project teams or departments
|
||||
6. Upload required documents
|
||||
7. Save employee record
|
||||
|
||||
### Employee Management
|
||||
1. Search and filter employee records
|
||||
2. Update employee information as needed
|
||||
3. Track qualification expiration dates
|
||||
4. Monitor performance and attendance
|
||||
5. Generate employee reports
|
||||
|
||||
### Employee Categories
|
||||
- **Project Personnel**: Direct project team members
|
||||
- **Support Staff**: Administrative and support personnel
|
||||
- **Contractors**: Contract-based employees
|
||||
- **Specialists**: Technical specialists and experts
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Keep employee information current and accurate
|
||||
- ✅ Track qualification expiration dates
|
||||
- ✅ Monitor employee performance regularly
|
||||
- ✅ Maintain proper documentation for all employees
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify employee qualifications and certifications
|
||||
- ✅ Ensure compliance with labor regulations
|
||||
- ✅ Regular review of employee records
|
||||
- ✅ Maintain data privacy and security
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Cannot add employee**: Check user permissions and required fields
|
||||
2. **Qualification not updating**: Verify qualification details and dates
|
||||
3. **Report generation fails**: Check data integrity and system status
|
||||
|
||||
### Getting Help
|
||||
- Contact the HR department for technical support
|
||||
- Consult employee management procedures
|
||||
- Check employee data and qualification records
|
||||
@@ -1,312 +0,0 @@
|
||||
# Employees User Guide
|
||||
|
||||
## What is the Employees Module?
|
||||
|
||||
The Employees module manages all personnel information for your project. This includes workers, supervisors, inspectors, and support staff - everyone who works on the project needs to be properly registered and tracked here.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Employees:
|
||||
1. Login to the system
|
||||
2. Click on **Employees** in the main menu
|
||||
3. View existing personnel or add new employees
|
||||
|
||||
## Understanding Employee Information
|
||||
|
||||
### Basic Employee Data
|
||||
Each employee record contains:
|
||||
- **Personal Information**: Name, ID number, contact details
|
||||
- **Job Information**: Position, department, supervisor
|
||||
- **Qualifications**: Certifications, training records
|
||||
- **Project Details**: Start date, work area, access levels
|
||||
- **Emergency Contacts**: Next of kin information
|
||||
|
||||
### Employee Categories
|
||||
**Construction Personnel:**
|
||||
- **Craft Workers**: Welders, pipefitters, electricians, etc.
|
||||
- **Supervisors**: Foremen, lead workers, area supervisors
|
||||
- **Quality Control**: Inspectors, QC engineers
|
||||
- **Support Staff**: Laborers, helpers, material handlers
|
||||
|
||||
**Professional Staff:**
|
||||
- **Engineers**: Design, construction, quality engineers
|
||||
- **Managers**: Project, construction, QC managers
|
||||
- **Specialists**: NDT technicians, safety officers
|
||||
- **Administrative**: HR, accounting, procurement staff
|
||||
|
||||
## Adding New Employees
|
||||
|
||||
### Basic Information Entry
|
||||
1. Click **"Add New Employee"**
|
||||
2. Fill in required fields:
|
||||
- **Full Name**: Complete legal name
|
||||
- **Employee ID**: Unique identifier (often badge number)
|
||||
- **Position/Trade**: Job title or craft
|
||||
- **Department**: Which group they work for
|
||||
- **Start Date**: When they began on project
|
||||
|
||||
### Personal Details
|
||||
**Contact Information:**
|
||||
- **Phone Numbers**: Primary and backup contacts
|
||||
- **Email Address**: For official communications
|
||||
- **Home Address**: Emergency contact purposes
|
||||
- **Emergency Contact**: Next of kin information
|
||||
|
||||
**Identification:**
|
||||
- **National ID**: Government identification number
|
||||
- **Passport Number**: For international workers
|
||||
- **Work Permit**: Immigration status if applicable
|
||||
- **Social Security**: For payroll and benefits
|
||||
|
||||
### Employment Information
|
||||
**Job Details:**
|
||||
- **Job Title**: Specific position
|
||||
- **Trade/Craft**: Specialized skill (welder, fitter, etc.)
|
||||
- **Supervisor**: Who they report to
|
||||
- **Work Area**: Where they're assigned
|
||||
- **Shift**: Day, night, rotating schedule
|
||||
|
||||
**Compensation:**
|
||||
- **Pay Rate**: Hourly or salary information
|
||||
- **Pay Grade**: Level within organization
|
||||
- **Overtime Rate**: Premium pay calculations
|
||||
- **Benefits**: Health, vacation, other benefits
|
||||
|
||||
## Managing Qualifications
|
||||
|
||||
### Certification Tracking
|
||||
**Required Certifications:**
|
||||
- **Welding Certifications**: ASME, AWS, etc.
|
||||
- **Safety Training**: Basic safety, confined space, etc.
|
||||
- **Equipment Operation**: Crane, forklift, etc.
|
||||
- **Trade Licenses**: Electrical, plumbing, etc.
|
||||
- **First Aid/CPR**: Emergency response training
|
||||
|
||||
### Certification Management
|
||||
**Tracking Information:**
|
||||
- **Certification Type**: What skill is certified
|
||||
- **Certifying Body**: Who issued the certification
|
||||
- **Issue Date**: When certification was granted
|
||||
- **Expiration Date**: When renewal is needed
|
||||
- **Certificate Number**: Official reference number
|
||||
|
||||
**Renewal Tracking:**
|
||||
- **Advance Warnings**: Alert when renewal due
|
||||
- **Training Schedules**: Plan renewal training
|
||||
- **Cost Tracking**: Budget for certification costs
|
||||
- **Compliance Monitoring**: Ensure current certifications
|
||||
|
||||
## Safety and Compliance
|
||||
|
||||
### Safety Training Records
|
||||
**Required Training:**
|
||||
- **Site Orientation**: Project-specific safety training
|
||||
- **OSHA Training**: General industry safety requirements
|
||||
- **Hazcom Training**: Chemical safety information
|
||||
- **PPE Training**: Personal protective equipment use
|
||||
- **Emergency Procedures**: Evacuation, fire safety, etc.
|
||||
|
||||
### Medical Information
|
||||
**Health Records:**
|
||||
- **Medical Clearance**: Fitness for duty certification
|
||||
- **Physical Restrictions**: Work limitations if any
|
||||
- **Medical Conditions**: Conditions affecting work
|
||||
- **Medications**: That might affect performance
|
||||
- **Emergency Medical Info**: Allergies, conditions, etc.
|
||||
|
||||
### Drug and Alcohol Testing
|
||||
**Testing Programs:**
|
||||
- **Pre-employment**: Required before starting
|
||||
- **Random Testing**: Ongoing compliance program
|
||||
- **Post-incident**: After accidents or incidents
|
||||
- **Reasonable Suspicion**: When problems suspected
|
||||
- **Return to Duty**: After treatment programs
|
||||
|
||||
## Access Control and Security
|
||||
|
||||
### Site Access Management
|
||||
**Badge and Access:**
|
||||
- **Security Badge**: Photo ID for site access
|
||||
- **Access Levels**: Which areas they can enter
|
||||
- **Vehicle Permits**: Authorized vehicles on site
|
||||
- **Escort Requirements**: Areas requiring accompaniment
|
||||
- **Special Clearances**: High-security areas
|
||||
|
||||
### IT System Access
|
||||
**System Permissions:**
|
||||
- **User Accounts**: Login credentials for systems
|
||||
- **Permission Levels**: What functions they can use
|
||||
- **Module Access**: Which parts of system available
|
||||
- **Data Access**: What information they can see
|
||||
- **Administrative Rights**: Special privileges if any
|
||||
|
||||
## Performance and Discipline
|
||||
|
||||
### Performance Tracking
|
||||
**Performance Metrics:**
|
||||
- **Productivity**: Work output and efficiency
|
||||
- **Quality**: Error rates and rework
|
||||
- **Safety**: Incident rates and behavior
|
||||
- **Attendance**: Punctuality and reliability
|
||||
- **Teamwork**: Cooperation and communication
|
||||
|
||||
### Disciplinary Actions
|
||||
**Progressive Discipline:**
|
||||
- **Verbal Warning**: First-level correction
|
||||
- **Written Warning**: Formal documentation
|
||||
- **Suspension**: Temporary removal from work
|
||||
- **Final Warning**: Last chance before termination
|
||||
- **Termination**: End of employment
|
||||
|
||||
**Documentation Requirements:**
|
||||
- **Incident Reports**: What happened and when
|
||||
- **Witness Statements**: Other people's observations
|
||||
- **Corrective Actions**: What employee must do
|
||||
- **Follow-up Plans**: Monitoring and support
|
||||
- **Appeals Process**: How to contest actions
|
||||
|
||||
## Payroll Integration
|
||||
|
||||
### Time and Attendance
|
||||
**Time Tracking:**
|
||||
- **Regular Hours**: Normal work time
|
||||
- **Overtime Hours**: Premium time worked
|
||||
- **Holiday Pay**: Compensation for holidays
|
||||
- **Vacation Time**: Paid time off used
|
||||
- **Sick Leave**: Medical time off
|
||||
|
||||
**Project Time Allocation:**
|
||||
- **Work Orders**: Specific tasks worked on
|
||||
- **Cost Centers**: Which budget charged
|
||||
- **Equipment Time**: Machinery operation time
|
||||
- **Travel Time**: Transportation to work areas
|
||||
- **Training Time**: Time spent in training
|
||||
|
||||
### Benefits Administration
|
||||
**Benefit Programs:**
|
||||
- **Health Insurance**: Medical, dental, vision
|
||||
- **Retirement Plans**: 401k, pension contributions
|
||||
- **Life Insurance**: Basic and supplemental coverage
|
||||
- **Disability Insurance**: Short and long-term coverage
|
||||
- **Flexible Benefits**: Cafeteria plans, FSA accounts
|
||||
|
||||
## Reporting and Analytics
|
||||
|
||||
### Personnel Reports
|
||||
**Common Reports:**
|
||||
- **Headcount Reports**: How many people by category
|
||||
- **Certification Status**: Who needs renewals
|
||||
- **Training Completion**: Progress on required training
|
||||
- **Safety Statistics**: Incident rates by group
|
||||
- **Turnover Analysis**: Hiring and separation trends
|
||||
|
||||
### Compliance Reporting
|
||||
**Required Reports:**
|
||||
- **EEO Reports**: Equal employment opportunity
|
||||
- **OSHA Logs**: Safety incident reporting
|
||||
- **Payroll Reports**: Tax and benefit reporting
|
||||
- **Immigration Reports**: Foreign worker status
|
||||
- **Union Reports**: Labor agreement compliance
|
||||
|
||||
## Mobile Access
|
||||
|
||||
### Field Updates
|
||||
**Mobile Capabilities:**
|
||||
- **Time Entry**: Clock in/out from work areas
|
||||
- **Training Records**: Update completion status
|
||||
- **Safety Incidents**: Report problems immediately
|
||||
- **Contact Updates**: Change phone or address
|
||||
- **Schedule Access**: View work assignments
|
||||
|
||||
### Supervisor Functions
|
||||
**Management Tools:**
|
||||
- **Team Rosters**: See who's assigned to area
|
||||
- **Attendance Tracking**: Monitor who's present
|
||||
- **Performance Notes**: Document observations
|
||||
- **Training Assignments**: Schedule required training
|
||||
- **Approval Workflows**: Approve time off requests
|
||||
|
||||
## Data Privacy and Security
|
||||
|
||||
### Confidential Information
|
||||
**Protected Data:**
|
||||
- **Personal Information**: SSN, addresses, medical info
|
||||
- **Financial Data**: Pay rates, bank information
|
||||
- **Performance Records**: Evaluations, discipline
|
||||
- **Background Checks**: Criminal history, references
|
||||
- **Family Information**: Emergency contacts, dependents
|
||||
|
||||
### Access Controls
|
||||
**Data Security:**
|
||||
- **Need to Know**: Only authorized personnel access
|
||||
- **Audit Trails**: Track who accessed what data
|
||||
- **Regular Reviews**: Verify access still appropriate
|
||||
- **Data Retention**: How long to keep records
|
||||
- **Disposal Procedures**: Secure destruction of records
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Data Quality
|
||||
- ✅ **Verify information** before entering
|
||||
- ✅ **Keep records current** with regular updates
|
||||
- ✅ **Use consistent formats** for data entry
|
||||
- ✅ **Document sources** of information
|
||||
- ✅ **Regular audits** to ensure accuracy
|
||||
|
||||
### Communication
|
||||
- ✅ **Notify employees** of changes affecting them
|
||||
- ✅ **Maintain confidentiality** of sensitive information
|
||||
- ✅ **Respond promptly** to employee questions
|
||||
- ✅ **Keep supervisors informed** of status changes
|
||||
- ✅ **Document all interactions** appropriately
|
||||
|
||||
### Compliance
|
||||
- ✅ **Know legal requirements** for your jurisdiction
|
||||
- ✅ **Stay current** with changing regulations
|
||||
- ✅ **Train staff** on proper procedures
|
||||
- ✅ **Audit compliance** regularly
|
||||
- ✅ **Correct deficiencies** promptly
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Can't add new employee:**
|
||||
- Check all required fields completed
|
||||
- Verify unique employee ID
|
||||
- Ensure proper user permissions
|
||||
- Try refreshing page and retry
|
||||
|
||||
**Information not saving:**
|
||||
- Verify internet connection
|
||||
- Check for data validation errors
|
||||
- Ensure proper format for dates/numbers
|
||||
- Contact IT if problem persists
|
||||
|
||||
**Missing employee records:**
|
||||
- Check spelling of name/ID
|
||||
- Try broader search terms
|
||||
- Verify correct database/project
|
||||
- Check if employee transferred
|
||||
|
||||
## Getting Help
|
||||
|
||||
**For HR Policy Questions:**
|
||||
- Review employee handbook
|
||||
- Consult HR manager
|
||||
- Check company policies
|
||||
- Contact corporate HR
|
||||
|
||||
**For System Issues:**
|
||||
- Try basic troubleshooting first
|
||||
- Document specific error messages
|
||||
- Contact IT support
|
||||
- Provide employee ID for reference
|
||||
|
||||
**For Legal/Compliance Issues:**
|
||||
- Consult legal department
|
||||
- Review applicable regulations
|
||||
- Contact compliance officer
|
||||
- Document all actions taken
|
||||
|
||||
Remember: Proper employee management ensures project success and regulatory compliance while protecting individual privacy and rights!
|
||||
@@ -1,513 +0,0 @@
|
||||
# ExcelRowHandler Service Guide
|
||||
|
||||
## Overview
|
||||
|
||||
The `ExcelRowHandler` service is a modern, object-oriented replacement for the `addRowInTable` helper function. It provides a clean and maintainable way to add formatted rows to Excel sheets in the Register Creator system.
|
||||
|
||||
## Location
|
||||
|
||||
- **Service Class**: `App\Services\RegisterCreator\ExcelRowHandler`
|
||||
- **Integration**: `App\Services\RegisterCreator\DocumentProcessors\AbstractDocumentProcessor`
|
||||
|
||||
## Features
|
||||
|
||||
- ✅ **Duplicate Detection**: Automatically prevents duplicate report entries
|
||||
- ✅ **File Management**: Handles PDF and XLSX file copying with smart overwrite logic
|
||||
- ✅ **Page Counting**: Automatically counts PDF pages using pdftk
|
||||
- ✅ **Excel Formatting**: Preserves styles, formulas, merged cells, and row heights
|
||||
- ✅ **Comprehensive Logging**: Provides detailed logging with emoji indicators
|
||||
- ✅ **Statistics Tracking**: Tracks file types and successful operations
|
||||
- ✅ **Type Safety**: Full PHP type hints for better IDE support and error prevention
|
||||
|
||||
## Architecture
|
||||
|
||||
### Service Class: ExcelRowHandler
|
||||
|
||||
The main service class handles all row addition operations:
|
||||
|
||||
```php
|
||||
use App\Services\RegisterCreator\ExcelRowHandler;
|
||||
|
||||
$handler = new ExcelRowHandler();
|
||||
|
||||
$newRow = $handler->addRow(
|
||||
$search, // Array of file paths to search
|
||||
$selectDocument, // Document information array
|
||||
$fullFolder, // Target folder path
|
||||
$lineNumber, // Line identifier
|
||||
$documentDate, // Document date
|
||||
$rowNo, // Row sequence number
|
||||
$sheet, // PhpSpreadsheet Worksheet object
|
||||
$currentRow, // Current row position
|
||||
$override // Whether to overwrite existing files
|
||||
);
|
||||
```
|
||||
|
||||
### Integration with AbstractDocumentProcessor
|
||||
|
||||
The service is integrated into `AbstractDocumentProcessor` for easy use in all document processors:
|
||||
|
||||
```php
|
||||
protected function addRowToExcel(
|
||||
array $search,
|
||||
string $lineNumber,
|
||||
string $documentDate,
|
||||
int $rowNo
|
||||
): int
|
||||
```
|
||||
|
||||
## Usage in Document Processors
|
||||
|
||||
### Basic Usage Example
|
||||
|
||||
Here's how to use the service in a document processor:
|
||||
|
||||
```php
|
||||
class MyDocumentProcessor extends AbstractDocumentProcessor
|
||||
{
|
||||
public function process(
|
||||
array $weldLogData,
|
||||
array $document,
|
||||
Worksheet $sheet,
|
||||
int &$currentRow,
|
||||
array $settings
|
||||
): int {
|
||||
// Initialize processor (this creates the ExcelRowHandler instance)
|
||||
$this->initialize($weldLogData, $document, $sheet, $currentRow, $settings);
|
||||
|
||||
// Get line identifier
|
||||
$lineIdentifier = $weldLogData[$this->registerColumnBased];
|
||||
|
||||
// Search for files
|
||||
$search = $this->searchFiles("{$document['path']}/*{$lineIdentifier}*.pdf");
|
||||
|
||||
// Get document date
|
||||
$placeholderReplacer = new \App\Services\RegisterCreator\PlaceholderReplacer();
|
||||
$documentDate = $placeholderReplacer->getLatestDate($weldLogData, $this->registerColumnBased);
|
||||
|
||||
// Add row to Excel using the service
|
||||
$newRow = $this->addRowToExcel(
|
||||
$search,
|
||||
$lineIdentifier,
|
||||
$documentDate,
|
||||
1 // Row number in sequence
|
||||
);
|
||||
|
||||
if ($newRow > $currentRow) {
|
||||
$currentRow = $newRow;
|
||||
}
|
||||
|
||||
return $currentRow;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Real Example: DrawingsProcessor
|
||||
|
||||
```php
|
||||
class DrawingsProcessor extends AbstractDocumentProcessor
|
||||
{
|
||||
public function process(
|
||||
array $weldLogData,
|
||||
array $document,
|
||||
Worksheet $sheet,
|
||||
int &$currentRow,
|
||||
array $settings
|
||||
): int {
|
||||
$this->initialize($weldLogData, $document, $sheet, $currentRow, $settings);
|
||||
|
||||
$this->log("Processing Drawings");
|
||||
|
||||
$lineIdentifier = $weldLogData[$this->registerColumnBased];
|
||||
$normalized = $this->normalizeSearchTerm($lineIdentifier);
|
||||
$search = $this->searchFiles("{$document['path']}/*{$normalized}*.pdf");
|
||||
|
||||
$placeholderReplacer = new \App\Services\RegisterCreator\PlaceholderReplacer();
|
||||
$documentDate = $placeholderReplacer->getLatestDate($weldLogData, $this->registerColumnBased);
|
||||
|
||||
// Use the new ExcelRowHandler service method
|
||||
$newRow = $this->addRowToExcel(
|
||||
$search,
|
||||
$lineIdentifier,
|
||||
$documentDate,
|
||||
1
|
||||
);
|
||||
|
||||
if ($newRow > $currentRow) {
|
||||
$currentRow = $newRow;
|
||||
}
|
||||
|
||||
return $currentRow;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Method Parameters
|
||||
|
||||
### addRow() Method
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| `$search` | `array` | Array of file paths to search for |
|
||||
| `$selectDocument` | `array` | Document information containing title, path, type, order, etc. |
|
||||
| `$fullFolder` | `string` | Target folder path (e.g., "storage/documents/project/line/") |
|
||||
| `$lineNumber` | `string` | Line number or identifier |
|
||||
| `$documentDate` | `string` | Document date |
|
||||
| `$rowNo` | `int` | Row sequence number |
|
||||
| `$sheet` | `Worksheet` | PhpSpreadsheet Worksheet object (passed by reference) |
|
||||
| `$currentRow` | `int` | Current row position in Excel |
|
||||
| `$override` | `bool` | Whether to overwrite existing files (default: false) |
|
||||
|
||||
**Returns**: `int` - Next row position
|
||||
|
||||
### addRowToExcel() Helper Method
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| `$search` | `array` | Array of file paths to search for |
|
||||
| `$lineNumber` | `string` | Line number or identifier |
|
||||
| `$documentDate` | `string` | Document date |
|
||||
| `$rowNo` | `int` | Row sequence number |
|
||||
|
||||
**Returns**: `int` - Next row position
|
||||
|
||||
## Document Information Structure
|
||||
|
||||
The `$selectDocument` array should contain:
|
||||
|
||||
```php
|
||||
[
|
||||
'title1' => 'Main title',
|
||||
'title2' => 'NDT Report Number',
|
||||
'title3' => 'PDF Document Title',
|
||||
'title4' => 'NDT Register Title',
|
||||
'path' => 'storage/documents/...',
|
||||
'type' => 'drawing|template|...',
|
||||
'order' => 0, // Display order
|
||||
'file_name' => 'Custom file name (optional)',
|
||||
'incoming_control_description' => 'Description (optional)'
|
||||
]
|
||||
```
|
||||
|
||||
## Excel Template Placeholders
|
||||
|
||||
The service replaces the following placeholders in the Excel template:
|
||||
|
||||
| Placeholder | Description |
|
||||
|-------------|-------------|
|
||||
| `{rowNo}` | Row sequence number |
|
||||
| `{type_order_no}` | Document type order number (e.g., 1 for QA, 2 for WDB) |
|
||||
| `{sub_number}` | Sub-number within document type (1, 2, 3...) |
|
||||
| `{full_number}` | Combined number in format "type_order_no.sub_number" (e.g., "1.1", "1.2", "3.1") |
|
||||
| `{rowTitle}` | Document title (processed) |
|
||||
| `{documentReportNumber}` | Line number/identifier |
|
||||
| `{documentDate}` | Formatted document date |
|
||||
| `{constructor}` | Contractor name |
|
||||
| `{pageCount}` | Number of pages in PDF |
|
||||
| `{pageIndex}` | Page range (e.g., "1-3") |
|
||||
| `{title1}` | Document title 1 |
|
||||
| `{ndt_report_no}` | NDT report number (title2) |
|
||||
| `{pdf_document_title}` | PDF document title (title3) |
|
||||
| `{ndt_register_title}` | NDT register title (title4) |
|
||||
|
||||
## Log Format
|
||||
|
||||
The service generates structured logs with emoji indicators:
|
||||
|
||||
```
|
||||
📋 1. Document Title - LINE001 | 1 file(s)
|
||||
-- filename.pdf
|
||||
📁 File: copied
|
||||
|
||||
📋 2. Another Document - LINE002 | 2 file(s)
|
||||
-- document1.pdf
|
||||
-- document2.pdf
|
||||
📁 File: updated
|
||||
📊 XLSX: copied
|
||||
|
||||
❌ 3. Missing Document - LINE003 | NO FILES FOUND
|
||||
Search paths:
|
||||
-- expected_filename.pdf
|
||||
|
||||
🔄 DUPLICATE: Report Title - LINE001
|
||||
```
|
||||
|
||||
### Log Indicators
|
||||
|
||||
- 📋 = Document processed
|
||||
- ✅ = Success
|
||||
- ❌ = Error or not found
|
||||
- 🔄 = Duplicate (skipped)
|
||||
- 📁 = PDF file operation
|
||||
- 📊 = XLSX file operation
|
||||
- ❓ = Warning or missing optional file
|
||||
|
||||
### File Copy Status
|
||||
|
||||
- `copied` = New file copied
|
||||
- `updated` = File content changed, updated
|
||||
- `overwritten` = File forcefully overwritten (override=true)
|
||||
- `same content, skipped` = File exists with same content, no action needed
|
||||
|
||||
## File Management
|
||||
|
||||
### PDF Files
|
||||
|
||||
All PDF files are automatically:
|
||||
1. Validated for existence
|
||||
2. Page counted using pdftk
|
||||
3. Copied to target location
|
||||
4. Named according to order and title
|
||||
|
||||
### XLSX Files (Templates)
|
||||
|
||||
For documents with type="template":
|
||||
1. Searches for corresponding .xlsx file
|
||||
2. Copies alongside PDF if found
|
||||
3. Logs result (found/not found)
|
||||
|
||||
### Smart Copy Logic
|
||||
|
||||
The service uses MD5 hash comparison to avoid unnecessary file operations:
|
||||
- If file exists and content is identical → skip
|
||||
- If file exists and content differs → update
|
||||
- If override flag is true → always overwrite
|
||||
|
||||
## Statistics
|
||||
|
||||
The service tracks statistics that can be accessed statically:
|
||||
|
||||
```php
|
||||
// Get file type statistics
|
||||
$stats = ExcelRowHandler::getFileTypeStats();
|
||||
// Returns: ['pdf' => 150, 'xlsx' => 25, ...]
|
||||
|
||||
// Get successful operations count
|
||||
$count = ExcelRowHandler::getSuccessfulOperations();
|
||||
// Returns: 150
|
||||
|
||||
// Reset statistics
|
||||
ExcelRowHandler::resetStatistics();
|
||||
```
|
||||
|
||||
## Duplicate Prevention
|
||||
|
||||
The service automatically prevents duplicate entries based on:
|
||||
- Document title (title2)
|
||||
- Line number
|
||||
|
||||
If a duplicate is detected:
|
||||
1. Row is skipped
|
||||
2. Duplicate log is written
|
||||
3. Original row position is returned (no increment)
|
||||
|
||||
## Error Handling
|
||||
|
||||
The service handles errors gracefully:
|
||||
|
||||
```php
|
||||
try {
|
||||
$newRow = $this->addRowToExcel($search, $lineNumber, $documentDate, 1);
|
||||
} catch (\Throwable $th) {
|
||||
// Error is logged automatically
|
||||
// Exception is re-thrown for upstream handling
|
||||
}
|
||||
```
|
||||
|
||||
### Error Logging
|
||||
|
||||
All errors are logged to:
|
||||
1. Laravel log (with context)
|
||||
2. Project-specific log.txt file
|
||||
3. Console output
|
||||
|
||||
## Cache Dependencies
|
||||
|
||||
The service relies on cached values:
|
||||
|
||||
| Cache Key | Description |
|
||||
|-----------|-------------|
|
||||
| `rc_contractor` | Contractor name |
|
||||
| `rc_firstPage` | First page number |
|
||||
| `rc_lastPage` | Last page number |
|
||||
| `rc_template_row` | Template row number |
|
||||
|
||||
These are managed by `RegisterCreatorService`.
|
||||
|
||||
## Migration from addRowInTable Helper
|
||||
|
||||
### Old Way (Helper Function)
|
||||
|
||||
```php
|
||||
$newRow = addRowInTable(
|
||||
$search,
|
||||
$document,
|
||||
$this->getFullFolder(),
|
||||
$lineIdentifier,
|
||||
$documentDate,
|
||||
1,
|
||||
$this->sheet,
|
||||
$currentRow,
|
||||
$this->settings['override'] ?? true
|
||||
);
|
||||
```
|
||||
|
||||
### New Way (Service Method)
|
||||
|
||||
```php
|
||||
$newRow = $this->addRowToExcel(
|
||||
$search,
|
||||
$lineIdentifier,
|
||||
$documentDate,
|
||||
1
|
||||
);
|
||||
```
|
||||
|
||||
### Benefits of Migration
|
||||
|
||||
1. **Cleaner Code**: Less parameters, more intuitive
|
||||
2. **Better Testability**: Service can be mocked and tested
|
||||
3. **Type Safety**: Full type hints
|
||||
4. **Object-Oriented**: Follows SOLID principles
|
||||
5. **Easier Maintenance**: All logic in one place
|
||||
6. **Better IDE Support**: Autocomplete and hints
|
||||
|
||||
## Best Practices
|
||||
|
||||
### 1. Always Initialize
|
||||
|
||||
```php
|
||||
$this->initialize($weldLogData, $document, $sheet, $currentRow, $settings);
|
||||
```
|
||||
|
||||
This creates the ExcelRowHandler instance and sets up necessary properties.
|
||||
|
||||
### 2. Update Current Row
|
||||
|
||||
```php
|
||||
$newRow = $this->addRowToExcel(...);
|
||||
|
||||
if ($newRow > $currentRow) {
|
||||
$currentRow = $newRow;
|
||||
}
|
||||
```
|
||||
|
||||
Always check if row was actually added before updating position.
|
||||
|
||||
### 3. Handle Search Results
|
||||
|
||||
```php
|
||||
$search = $this->searchFiles("{$document['path']}/*{$normalized}*.pdf");
|
||||
|
||||
if (empty($search)) {
|
||||
$this->log("No files found for pattern", "warning");
|
||||
return $currentRow;
|
||||
}
|
||||
```
|
||||
|
||||
Check if files exist before calling addRowToExcel.
|
||||
|
||||
### 4. Use Normalized Search Terms
|
||||
|
||||
```php
|
||||
$normalized = $this->normalizeSearchTerm($lineIdentifier);
|
||||
$search = $this->searchFiles("{$document['path']}/*{$normalized}*.pdf");
|
||||
```
|
||||
|
||||
Normalize search terms for better file matching.
|
||||
|
||||
### 5. Log Processing Steps
|
||||
|
||||
```php
|
||||
$this->log("Processing Drawings");
|
||||
$newRow = $this->addRowToExcel(...);
|
||||
$this->log("Drawings processed successfully");
|
||||
```
|
||||
|
||||
Use the log() method for consistent logging.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Files Not Found
|
||||
|
||||
1. Check file paths in search array
|
||||
2. Verify storage permissions
|
||||
3. Check if files exist in expected location
|
||||
4. Review log.txt for exact search paths
|
||||
|
||||
### Duplicate Detection Issues
|
||||
|
||||
1. Check title2 field consistency
|
||||
2. Verify line number format
|
||||
3. Reset statistics if testing: `ExcelRowHandler::resetStatistics()`
|
||||
|
||||
### Page Count Issues
|
||||
|
||||
1. Ensure pdftk is installed: `which pdftk`
|
||||
2. Check LANG environment variable
|
||||
3. Verify PDF file is not corrupted
|
||||
|
||||
### Excel Formatting Issues
|
||||
|
||||
1. Verify template row is set correctly
|
||||
2. Check placeholder names match exactly
|
||||
3. Ensure template has proper merged cells
|
||||
|
||||
## Performance Considerations
|
||||
|
||||
1. **File Operations**: Uses Laravel Storage for efficiency
|
||||
2. **MD5 Comparison**: Only calculates when necessary
|
||||
3. **Static Properties**: Shared across instances for statistics
|
||||
4. **Lazy Loading**: PDFs only opened when needed
|
||||
|
||||
## Testing
|
||||
|
||||
Example test structure:
|
||||
|
||||
```php
|
||||
use Tests\TestCase;
|
||||
use App\Services\RegisterCreator\ExcelRowHandler;
|
||||
|
||||
class ExcelRowHandlerTest extends TestCase
|
||||
{
|
||||
public function test_adds_row_successfully()
|
||||
{
|
||||
$handler = new ExcelRowHandler();
|
||||
|
||||
// Setup test data
|
||||
$search = ['storage/documents/test.pdf'];
|
||||
$document = ['title2' => 'Test', 'order' => 0, ...];
|
||||
|
||||
// Execute
|
||||
$newRow = $handler->addRow(
|
||||
$search,
|
||||
$document,
|
||||
'storage/documents/test/',
|
||||
'LINE001',
|
||||
'2024-01-01',
|
||||
1,
|
||||
$this->mockSheet,
|
||||
10,
|
||||
false
|
||||
);
|
||||
|
||||
// Assert
|
||||
$this->assertEquals(11, $newRow);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [Register Creator Guide](./register-creator-guide.md)
|
||||
- [Save Trigger System Guide](./save-trigger-system-guide.md)
|
||||
- [Document Processors](./document-processors-guide.md)
|
||||
|
||||
## Version History
|
||||
|
||||
- **v1.0** (2024-10): Initial release
|
||||
- Migrated from addRowInTable helper function
|
||||
- Added full type hints
|
||||
- Improved error handling
|
||||
- Added statistics tracking
|
||||
|
||||
@@ -1,138 +0,0 @@
|
||||
# Ferrit Log User Guide
|
||||
|
||||
## What is the Ferrit Log Module?
|
||||
|
||||
The Ferrit Log module tracks and manages ferrite content measurements and testing records. This module helps monitor ferrite levels, track testing results, and ensure proper ferrite content management for welding and material quality control.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Ferrit Log:
|
||||
1. Login to the system
|
||||
2. Click on **NDT** in the main menu
|
||||
3. Select **Ferrit Log** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Ferrite Testing**: Track ferrite content measurements
|
||||
- **Result Management**: Manage testing results and records
|
||||
- **Quality Control**: Monitor ferrite content quality
|
||||
- **Documentation**: Maintain testing documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate ferrite testing reports
|
||||
- **Data Analysis**: Analyze ferrite content trends
|
||||
- **Export Options**: Export testing data in various formats
|
||||
- **Compliance Monitoring**: Monitor ferrite content compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing Ferrit Logs
|
||||
1. Click **"Add Test"** button
|
||||
2. Select material for ferrite testing
|
||||
3. Conduct ferrite content measurement
|
||||
4. Record testing results
|
||||
5. Document testing conditions
|
||||
6. Update ferrite log
|
||||
7. Generate testing reports
|
||||
|
||||
### Testing Management
|
||||
1. Review ferrite testing requirements
|
||||
2. Conduct ferrite content measurements
|
||||
3. Record testing results accurately
|
||||
4. Monitor ferrite content trends
|
||||
5. Generate testing reports
|
||||
|
||||
### Testing Categories
|
||||
- **Weld Testing**: Ferrite content in welds
|
||||
- **Base Material Testing**: Ferrite content in base materials
|
||||
- **Component Testing**: Ferrite content in components
|
||||
- **Quality Control Testing**: Quality control ferrite testing
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Conduct ferrite testing accurately
|
||||
- ✅ Record testing results promptly
|
||||
- ✅ Monitor ferrite content trends
|
||||
- ✅ Maintain proper documentation
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify testing accuracy and completeness
|
||||
- ✅ Ensure proper testing procedures
|
||||
- ✅ Monitor testing effectiveness
|
||||
- ✅ Regular review of testing processes
|
||||
|
||||
## Table Field Mapping
|
||||
|
||||
### Critical Field Name Differences
|
||||
|
||||
**IMPORTANT**: The `ferrite` table and `weld_logs` table have different field names:
|
||||
|
||||
1. **Result Field**:
|
||||
- **ferrite table**: `result_ferrite`
|
||||
- **weld_logs table**: `ferrite_result`
|
||||
|
||||
2. **Test Laboratory Field**:
|
||||
- **ferrite table**: `tester_name`
|
||||
- **weld_logs table**: `test_laboratory_ferrite`
|
||||
|
||||
3. **Check Date Field**:
|
||||
- **ferrite table**: `ferrite_request_date`
|
||||
- **weld_logs table**: `date_of_ferrite_check`
|
||||
|
||||
### Common Fields Between Tables
|
||||
|
||||
The following fields are shared between `ferrite` and `weld_logs` tables:
|
||||
- `contractor`, `project`, `design_area`, `line_specification`, `line_number`
|
||||
- `fluid_code`, `service_category`, `fluid_group`
|
||||
- `operating_temperature_s`, `operating_pressure_mpa`, `external_finish_type`
|
||||
- `iso_number`, `quantity_of_iso`, `iso_rev`, `spool_number`
|
||||
- `type_of_joint`, `no_of_the_joint_as_per_as_built_survey`, `type_of_welds`
|
||||
- `welding_date`, `wps_no`, `welding_method`
|
||||
- `welding_materials_1`, `welding_materials_1_lot_no`, `welding_materials_1_certificate_no`
|
||||
- `welding_materials_2`, `welding_materials_2_lot_no`, `welding_materials_2_certificate_no`
|
||||
- `welder_1`, `welder_2`, `certificate_no_1`, `wpq_report_1`, `certificate_no_2`, `wpq_report_2`
|
||||
- `member_no_1`, `material_no_1`, `ru_material_group_1`, `certificate_number_of_1`, `heat_number_1`
|
||||
- `nps_1`, `thickness_by_asme_1`, `outside_diameter_1`, `wall_thickness_1`, `element_code_1`
|
||||
- `member_no_2`, `material_no_2`, `ru_material_group_2`, `certificate_number_of_2`, `heat_number_2`
|
||||
- `nps_2`, `thickness_by_asme_2`, `outside_diameter_2`, `wall_thickness_2`, `element_code_2`
|
||||
- `ferrite_scope`, `ferrite_request_no`
|
||||
- `no_of_ferrite_check`
|
||||
- `real_welder_1`, `real_welder_2`
|
||||
|
||||
### Special Field Mappings
|
||||
|
||||
The `weldlog_update_system.php` handles special field mappings automatically:
|
||||
|
||||
```php
|
||||
// Automatic field mapping when updating from ferrite to weld_logs
|
||||
if(isset($data['tester_name'])) {
|
||||
$updateData['test_laboratory_ferrite'] = $data['tester_name'];
|
||||
}
|
||||
|
||||
if(isset($data['ferrite_request_date'])) {
|
||||
$updateData['date_of_ferrite_check'] = $data['ferrite_request_date'];
|
||||
}
|
||||
```
|
||||
|
||||
### Developer Notes
|
||||
|
||||
When updating data from `ferrite` table to `weld_logs` table:
|
||||
1. Always use `ferrite_result` (NOT `result_ferrite`) in `weldlog_accepted_columns()` function
|
||||
2. `test_laboratory_ferrite` and `date_of_ferrite_check` are NOT in `weldlog_accepted_columns()` - they are mapped separately
|
||||
3. Special field mappings are handled automatically by the system
|
||||
4. Ensure field names match the target table schema
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Testing errors**: Check equipment calibration and procedure
|
||||
2. **Result recording issues**: Verify data entry accuracy
|
||||
3. **Equipment problems**: Contact equipment maintenance
|
||||
4. **Field mapping errors**: Ensure correct field names are used (`result_ferrite` for ferrite table, `ferrite_result` for weld_logs table)
|
||||
|
||||
### Getting Help
|
||||
- Contact the NDT department for technical support
|
||||
- Consult ferrit log procedures and guidelines
|
||||
- Check testing equipment and calibration records
|
||||
@@ -1,75 +0,0 @@
|
||||
# General Settings User Guide
|
||||
|
||||
## What is the General Settings Module?
|
||||
|
||||
The General Settings module manages system-wide configuration settings and preferences. This module allows administrators to configure system parameters, user preferences, and general application settings to customize the system according to project requirements.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access General Settings:
|
||||
1. Login to the system
|
||||
2. Click on **Settings** in the main menu
|
||||
3. Select **General Settings** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **System Configuration**: Configure system-wide settings and parameters
|
||||
- **User Preferences**: Manage user interface and behavior preferences
|
||||
- **Application Settings**: Control application behavior and features
|
||||
- **Security Settings**: Manage security and access control settings
|
||||
|
||||
### Secondary Functions
|
||||
- **Backup Configuration**: Configure system backup settings
|
||||
- **Notification Settings**: Manage system notifications and alerts
|
||||
- **Integration Settings**: Configure external system integrations
|
||||
- **Performance Settings**: Optimize system performance parameters
|
||||
|
||||
## How to Use
|
||||
|
||||
### System Configuration
|
||||
1. Access General Settings module
|
||||
2. Navigate to different configuration categories
|
||||
3. Modify settings as needed
|
||||
4. Save configuration changes
|
||||
5. Test configuration changes
|
||||
6. Apply changes to system
|
||||
|
||||
### Configuration Categories
|
||||
- **User Interface**: Language, theme, layout settings
|
||||
- **Security**: Password policies, session management
|
||||
- **Notifications**: Email, SMS, system alerts
|
||||
- **Performance**: Cache, database, optimization settings
|
||||
|
||||
### User Preferences
|
||||
1. Set personal interface preferences
|
||||
2. Configure notification preferences
|
||||
3. Set default values for forms
|
||||
4. Customize dashboard layout
|
||||
5. Save personal settings
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Test configuration changes in development environment first
|
||||
- ✅ Document configuration changes
|
||||
- ✅ Regular backup of configuration settings
|
||||
- ✅ Monitor system performance after changes
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify configuration changes work correctly
|
||||
- ✅ Check system stability after changes
|
||||
- ✅ Ensure security settings are appropriate
|
||||
- ✅ Regular review of configuration settings
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Settings not saving**: Check user permissions and system status
|
||||
2. **Configuration errors**: Verify setting values and format
|
||||
3. **System performance issues**: Review performance settings
|
||||
|
||||
### Getting Help
|
||||
- Contact the IT department for technical support
|
||||
- Consult system configuration documentation
|
||||
- Check system logs for configuration errors
|
||||
@@ -1,78 +0,0 @@
|
||||
# Hand Over Status User Guide
|
||||
|
||||
## What is the Hand Over Status Module?
|
||||
|
||||
The Hand Over Status module tracks and manages the status of project handover activities between different phases, contractors, or departments. This module helps ensure smooth transitions, proper documentation, and completion of handover requirements.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Hand Over Status:
|
||||
1. Login to the system
|
||||
2. Click on **Dashboard** in the main menu
|
||||
3. Select **Hand Over Status** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Handover Tracking**: Track handover progress and status
|
||||
- **Documentation Management**: Manage handover documentation
|
||||
- **Approval Workflow**: Manage handover approval processes
|
||||
- **Status Reporting**: Generate handover status reports
|
||||
|
||||
### Secondary Functions
|
||||
- **Checklist Management**: Manage handover checklists and requirements
|
||||
- **Notification System**: Alert stakeholders about handover status
|
||||
- **Issue Tracking**: Track and resolve handover issues
|
||||
- **Progress Monitoring**: Monitor handover completion progress
|
||||
|
||||
## How to Use
|
||||
|
||||
### Creating Handover Records
|
||||
1. Click **"New Handover"** button
|
||||
2. Select handover type and parties involved
|
||||
3. Define handover scope and requirements
|
||||
4. Set handover schedule and milestones
|
||||
5. Assign responsible personnel
|
||||
6. Create handover checklist
|
||||
7. Submit for approval
|
||||
|
||||
### Handover Process
|
||||
1. Review handover requirements and scope
|
||||
2. Complete handover checklist items
|
||||
3. Prepare handover documentation
|
||||
4. Conduct handover meetings
|
||||
5. Obtain necessary approvals
|
||||
6. Update handover status
|
||||
7. Close handover record
|
||||
|
||||
### Handover Categories
|
||||
- **Phase Handovers**: Between project phases
|
||||
- **Contractor Handovers**: Between contractors
|
||||
- **Department Handovers**: Between departments
|
||||
- **System Handovers**: System or equipment handovers
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Complete all handover requirements before approval
|
||||
- ✅ Document all handover activities and decisions
|
||||
- ✅ Ensure proper communication between parties
|
||||
- ✅ Follow established handover procedures
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify handover completion and documentation
|
||||
- ✅ Check handover checklist completion
|
||||
- ✅ Ensure proper approval and sign-off
|
||||
- ✅ Monitor handover effectiveness
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Handover stuck**: Check approval status and requirements
|
||||
2. **Missing documentation**: Ensure all required documents are prepared
|
||||
3. **Approval delays**: Contact responsible approvers
|
||||
|
||||
### Getting Help
|
||||
- Contact the Project Management department for support
|
||||
- Consult handover procedures and checklists
|
||||
- Check handover status and approval workflow
|
||||
@@ -1,100 +0,0 @@
|
||||
# Hand-Over Modülü Dokümantasyonu
|
||||
|
||||
Bu belge, `resources/views/admin/type/hand-over.blade.php` dosyasındaki Hand-Over modülü için sütun yapılarını, veri etkileşimlerini ve otomatik durum (status) mantığını açıklar.
|
||||
|
||||
## 1. Genel Yapı ve Sütun Grupları
|
||||
|
||||
Modül, dinamik olarak ayarlanan sayıda (varsayılan: 3) kontrol aşamasından oluşan bir onay sürecini yönetir. Veriler ana gruplar altında toplanır:
|
||||
|
||||
### General Info (Genel Bilgiler)
|
||||
Temel proje ve paket bilgilerinin girildiği alandır.
|
||||
- **Object, Location, Work Type, Project**: Paketin ait olduğu lokasyon ve proje detayları.
|
||||
- **Volumes (Hacimler)**:
|
||||
- `collected_volumes`: Toplanan hacim.
|
||||
- `not_collected_volumes`: Toplanmayan hacim (Varsayılan: 1).
|
||||
- `total_volumes`: **Otomatik Hesaplanır**. (`collected_volumes` + `not_collected_volumes`). Bu alan salt okunurdur.
|
||||
|
||||
### Control Aşamaları (Control 1, Control 2, ...)
|
||||
Her bir kontrol aşaması (varsayılan olarak 3 adet) aşağıdaki standart sütunları içerir:
|
||||
- **Controller**: Bu aşamadan sorumlu alt yüklenici veya firma (Seçim listesinden atanır).
|
||||
- **Date (1, 2, 3)**: İşlem tarihleri.
|
||||
- **Status**: Aşamanın durumu (`Agreed`, `Comment`, `Revision`).
|
||||
- **Comments**: Varsa notlar veya ret nedenleri.
|
||||
- **Responsible**: İşlemi yapan kişi.
|
||||
|
||||
**Otomatik İşlem:**
|
||||
- Bir kontrol aşamasına tarih (`date`) girildiğinde, `responsible` alanı boş ise, o anki oturum açmış kullanıcının adı otomatik olarak doldurulur.
|
||||
|
||||
### Location Info
|
||||
Arşivleme ve konum bilgilerini içerir.
|
||||
- **Archive**: Arşiv durumu.
|
||||
|
||||
---
|
||||
|
||||
## 2. Final Status (Nihai Durum) Mantığı
|
||||
|
||||
`Final Status` sütunu, tüm kontrol aşamalarındaki (Control 1, 2, 3...) durumlara bakarak **otomatik olarak** belirlenir. Bu sütun elle değiştirilemez (salt okunurdur).
|
||||
|
||||
Mantık sıralaması aşağıdaki gibidir:
|
||||
|
||||
1. **Hiçbir Kontrolcü Atanmamışsa:** Durum boştur.
|
||||
2. **Yorum (Comment) Varsa:** Herhangi bir aşamada "Comment / замечание" durumu varsa, `Final Status`, yorum yapan **ilk** kontrolcünün (firma) adı olur. (Öncelik yorumlardadır).
|
||||
3. **Tümü Onaylıysa (Agreed):** Atanan **tüm** kontrolcüler "Agreed / подписано" durumundaysa, `Final Status` **"Archive"** olur.
|
||||
4. **Sıradaki Kontrolcü:** Yukarıdakiler gerçekleşmemişse, sistem sırayla kontrol eder:
|
||||
- Eğer bir aşama "Agreed" ise ve bir sonraki aşamaya kontrolcü atanmışsa, `Final Status` bir sonraki kontrolcünün adı olur. Bu, dosyanın bir sonraki birime geçtiğini gösterir.
|
||||
|
||||
### Akış Diyagramı (Flowchart)
|
||||
|
||||
Aşağıdaki diyagram `updateFinalStatus` fonksiyonunun çalışma mantığını özetler:
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
Start[Değişiklik Algılandı] --> CheckController{Kontrolcü\nAtanmış mı?}
|
||||
|
||||
CheckController -- Hayır --> StatusEmpty[Durum: Boş]
|
||||
CheckController -- Evet --> CheckComment{Herhangi biri\n'Comment' mi?}
|
||||
|
||||
CheckComment -- Evet --> SetCommenter[Durum: İlk Yorum\nYapanın Adı]
|
||||
CheckComment -- Hayır --> CheckAllAgreed{HEPSİ\n'Agreed' mi?}
|
||||
|
||||
CheckAllAgreed -- Evet --> SetArchive[Durum: 'Archive']
|
||||
CheckAllAgreed -- Hayır --> FindNext[Sıradaki Aşama Kontrolü]
|
||||
|
||||
FindNext --> IsCurrentAgreed{Mevcut Aşama\n'Agreed' mi?}
|
||||
IsCurrentAgreed -- Evet --> CheckNextAssigned{Sonraki Kontrolcü\nVar mı?}
|
||||
|
||||
CheckNextAssigned -- Evet --> SetNext[Durum: Sonraki\nKontrolcünün Adı]
|
||||
CheckNextAssigned -- Hayır --> KeepCurrent[Durum Değişmez]
|
||||
IsCurrentAgreed -- Hayır --> KeepCurrent
|
||||
```
|
||||
|
||||
## 3. ID Status (Genel Durum) Mantığı
|
||||
|
||||
`id_status` sütunu, satırın genel durumunu temsil eder ve `Agreed`, `Comment`, `Revision` veya `Archive` değerlerinden birini alır. Bu sütun da **otomatik olarak** hesaplanır.
|
||||
|
||||
Mantık şu şekildedir:
|
||||
|
||||
1. **Tümü Onaylıysa:** Tüm kontrol aşamaları (`control*_id_status`) "Agreed / подписано" durumundaysa, `id_status` **"Agreed / подписано"** olur.
|
||||
2. **Değilse:** Eğer herhangi bir aşama "Agreed" değilse, `id_status` **"Archive"** sütunundaki değeri alır.
|
||||
|
||||
### ID Status Akış Diyagramı
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
Start[Değişiklik Algılandı] --> CheckMultiAgreed{Tüm Kontroller\n'Agreed' mi?}
|
||||
|
||||
CheckMultiAgreed -- Evet --> SetAgreed[Durum: 'Agreed']
|
||||
CheckMultiAgreed -- Hayır --> GetArchive{Archive Değeri\nNedir?}
|
||||
|
||||
GetArchive --> SetFromArchive[Durum: Archive Sütunundaki Değer]
|
||||
```
|
||||
|
||||
## 3. Veri Kaynakları ve İlişkiler
|
||||
|
||||
Sütunlar aşağıdaki veri kaynaklarından beslenir:
|
||||
- **Object / Project**: `weld_logs` tablosundan dinamik olarak çekilir.
|
||||
- **Work Type**: `work_types` tablosundan gelir.
|
||||
- **Controller**: `subcontractors` (alt yükleniciler) tablosundan listelenir.
|
||||
- **Responsible**: `work_permit_documents` tablosundaki kayıtlı personeller arasından seçilir.
|
||||
|
||||
Bu yapı, kullanıcı hatalarını en aza indirmek ve onay sürecinin (kimde olduğu bilgisinin) otomatik olarak takip edilmesini sağlamak amacıyla tasarlanmıştır.
|
||||
@@ -1,77 +0,0 @@
|
||||
# HT Log User Guide
|
||||
|
||||
## What is the HT Log Module?
|
||||
|
||||
The HT Log module tracks and documents Hardness Testing (HT) activities and results. This module helps ensure proper hardness testing procedures, monitor material hardness compliance, and maintain quality control records for various project components.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access HT Log:
|
||||
1. Login to the system
|
||||
2. Click on **NDT** in the main menu
|
||||
3. Select **HT Log** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Hardness Testing Logging**: Record hardness testing activities and results
|
||||
- **Quality Control**: Monitor hardness testing compliance and standards
|
||||
- **Data Analysis**: Analyze hardness testing trends and patterns
|
||||
- **Report Generation**: Generate hardness testing reports
|
||||
|
||||
### Secondary Functions
|
||||
- **Equipment Management**: Track hardness testing equipment calibration
|
||||
- **Operator Management**: Manage qualified hardness testing operators
|
||||
- **Documentation**: Maintain hardness testing records and procedures
|
||||
- **Alert System**: Alert when hardness values are out of specification
|
||||
|
||||
## How to Use
|
||||
|
||||
### Recording Hardness Tests
|
||||
1. Click **"New Hardness Test"** button
|
||||
2. Select the material or component to test
|
||||
3. Choose hardness testing method (Brinell, Rockwell, Vickers)
|
||||
4. Enter test location and conditions
|
||||
5. Record hardness values and measurements
|
||||
6. Add test observations and comments
|
||||
7. Save test record
|
||||
|
||||
### Quality Control Process
|
||||
1. Review hardness testing specifications
|
||||
2. Verify equipment calibration status
|
||||
3. Check operator qualifications
|
||||
4. Monitor testing accuracy and repeatability
|
||||
5. Document any deviations or issues
|
||||
6. Take corrective action if needed
|
||||
|
||||
### Testing Categories
|
||||
- **Base Materials**: Hardness testing of base materials
|
||||
- **Weld Joints**: Hardness testing of welded joints
|
||||
- **Heat Affected Zones**: Hardness testing of HAZ
|
||||
- **Special Applications**: Critical hardness requirements
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Always calibrate equipment before testing
|
||||
- ✅ Follow proper testing procedures and standards
|
||||
- ✅ Document test conditions accurately
|
||||
- ✅ Verify operator qualifications
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Check equipment calibration regularly
|
||||
- ✅ Verify testing accuracy and repeatability
|
||||
- ✅ Monitor hardness trends and patterns
|
||||
- ✅ Document any testing issues or deviations
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Testing errors**: Check equipment calibration and procedure
|
||||
2. **Out of specification**: Review material and processing parameters
|
||||
3. **Equipment malfunction**: Contact equipment maintenance
|
||||
|
||||
### Getting Help
|
||||
- Contact the NDT department for technical support
|
||||
- Consult hardness testing procedures and standards
|
||||
- Check equipment calibration records
|
||||
@@ -1,55 +0,0 @@
|
||||
## Non-Welded Joint Types – Final Roadmap
|
||||
|
||||
**Branch:** `feature/weldlog-non-welded-joints`
|
||||
**Scope:** Mechanical joints (BJ, FJ, TH, CJ) must be editable in grids but excluded from every welding-related calculation, report and sync path.
|
||||
|
||||
---
|
||||
|
||||
### 1. Foundation (Database + Helpers)
|
||||
- `joint_types` table now has `is_welded`, `is_mechanical`, `has_ndt` (see migrations `2025_11_14_181113_*`, `2025_11_14_181220_*`).
|
||||
- `MechanicalJointTypesSeeder` guarantees the core mechanical joints exist in every environment.
|
||||
- `JointTypeService` + `app/Functions/joint_type_helpers.php` cache joint-type lists and expose helpers:
|
||||
- `apply_welded_filter()` / `apply_mechanical_filter()` wrap any Builder or table name and add the correct `whereIn`.
|
||||
- `is_welded_joint`, `is_mechanical_joint`, `requires_ndt`, cache clear helpers.
|
||||
|
||||
### 2. DevExtreme Grid Behaviour
|
||||
- `resources/views/components/table/datagrid*.blade.php` handles everything:
|
||||
- Greys out mechanical rows, disables welder/WPS/NDT fields, keeps `fitter_name` + fit-up dates editable.
|
||||
- Footer SUM/AVG now send `excludeMechanicalSummary=1`; backend (`SummaryContext` + `AggregateHelper`) runs `CASE WHEN` filters so totals only consider welded joints.
|
||||
- `type_of_welds` dropdown restored for Weldlog/Weldmap (joint_types + fallback list).
|
||||
|
||||
### 3. Application Surfaces Updated
|
||||
| Area | Files | Result |
|
||||
| --- | --- | --- |
|
||||
| Dashboards & reports | `resources/views/admin-ajax/*`, `resources/views/admin/dashboard/chart/monthly-progress.blade.php` | Every weld log query wraps `apply_welded_filter`, so mechanical rows never inflate KPIs. |
|
||||
| Cron & sync jobs | `resources/views/cron/*.blade.php`, `app/Http/Controllers/SaveTrigger/test_pack_base_statuses.php` | Spool, paint, NDE and test-package syncs skip mechanical joints automatically. |
|
||||
| Register Creator & PDFs | `app/Services/RegisterCreator/...`, `resources/views/admin-ajax/pdf/*`, `generate-pdf-*` | Register exports and PDF builders read only welded joints; mechanical rows do not trigger file searches. |
|
||||
| Page modules | `resources/views/admin/type/weldlog.blade.php`, `weldmap*.blade.php`, `nde-matrix.blade.php`, `manage-ndt.blade.php`, `spool-release*` | All modules share the same helper-based filtering and the DevExtreme UI behaviour. |
|
||||
|
||||
### 4. Testing & Tooling
|
||||
- `php artisan mechanical:verify-summaries --columns=nps_1,...` validates SUM/AVG output; CLI table prints welded vs mechanical totals for audit.
|
||||
- Guide and roadmap (this file + `mechanical-overview.md`) explain the architecture and test plan.
|
||||
|
||||
### 5. Commands & References
|
||||
```bash
|
||||
# Seed mechanical joints (first-time environments)
|
||||
php artisan db:seed --class=MechanicalJointTypesSeeder
|
||||
|
||||
# Rebuild helper cache if joint_types table changes
|
||||
php artisan tinker --execute="clear_joint_types_cache();"
|
||||
|
||||
# Run SUM/AVG regression
|
||||
php artisan mechanical:verify-summaries --columns=nps_1,nps_2,outside_diameter_1,outside_diameter_2,wall_thickness_1,wall_thickness_2
|
||||
```
|
||||
|
||||
### 6. Key Principles
|
||||
1. **Never** query `weld_logs` without `apply_welded_filter()` unless the screen explicitly needs mechanical rows.
|
||||
2. Mechanical rows can exist in listings (for fit-up tracking) but should not trigger welding KPIs, NDT scopes, spool or paint logic.
|
||||
3. DevExtreme grids are the single source of UI logic; avoid duplicating mechanical detection per module.
|
||||
4. Register/PDF builders must only read welded joints to keep QA documentation aligned with real weld data.
|
||||
|
||||
---
|
||||
|
||||
**Last Updated:** 2025-11-21
|
||||
**Owner:** AI Assistant + Team
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
# Incoming Control Paint User Guide
|
||||
|
||||
## What is the Incoming Control Paint Module?
|
||||
|
||||
The Incoming Control Paint module manages quality control for incoming paint materials and supplies. This module helps ensure paint quality standards, track incoming paint inspections, and maintain proper paint material control.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Incoming Control Paint:
|
||||
1. Login to the system
|
||||
2. Click on **QC** in the main menu
|
||||
3. Select **Incoming Control Paint** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Quality Control**: Control incoming paint quality
|
||||
- **Inspection Management**: Manage paint material inspections
|
||||
- **Documentation**: Maintain inspection documentation
|
||||
- **Standards Compliance**: Ensure paint quality standards
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate inspection reports
|
||||
- **Supplier Management**: Manage paint suppliers
|
||||
- **Sample Testing**: Conduct paint sample testing
|
||||
- **Compliance Monitoring**: Monitor paint compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing Paint Control
|
||||
1. Click ** + ** button
|
||||
2. Select paint material for inspection
|
||||
3. Conduct quality control inspection
|
||||
4. Record inspection results
|
||||
5. Document inspection findings
|
||||
6. Update material status
|
||||
7. Generate inspection reports
|
||||
|
||||
### Control Management
|
||||
1. Review incoming paint materials
|
||||
2. Conduct quality control inspections
|
||||
3. Document inspection results
|
||||
4. Update material status
|
||||
5. Generate control reports
|
||||
|
||||
### Control Categories
|
||||
- **Paint Materials**: Paint material inspections
|
||||
- **Primers**: Primer material control
|
||||
- **Coatings**: Coating material inspections
|
||||
- **Solvents**: Solvent quality control
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Conduct thorough paint inspections
|
||||
- ✅ Document inspection results accurately
|
||||
- ✅ Monitor paint quality standards
|
||||
- ✅ Maintain proper control procedures
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify inspection accuracy and completeness
|
||||
- ✅ Ensure proper quality control procedures
|
||||
- ✅ Monitor control effectiveness
|
||||
- ✅ Regular review of control processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Inspection not saving**: Check all required fields are completed
|
||||
2. **Quality issues**: Review inspection procedures and standards
|
||||
3. **Documentation problems**: Check document upload and format
|
||||
|
||||
### Getting Help
|
||||
- Contact the QC department for technical support
|
||||
- Consult incoming control paint procedures and guidelines
|
||||
- Check inspection data and quality standards
|
||||
@@ -1,388 +0,0 @@
|
||||
# Incoming Control Task Analysis & Roadmap
|
||||
|
||||
## 📋 Task Overview
|
||||
|
||||
Bu dokümantasyon, Incoming Control modülü için yeni task'ın analizini ve uygulama roadmap'ini içermektedir.
|
||||
|
||||
---
|
||||
|
||||
## 🔍 Önceki Task'ta Yapılanlar (Tamamlanmış)
|
||||
|
||||
### 1. Incoming Control Popup Sistemi
|
||||
- ✅ Weldlog/Weldmap ekranlarında certificate no ve heat number alanlarına popup eklendi
|
||||
- ✅ Popup'ta incoming control verilerine erişim sağlandı
|
||||
- ✅ RFI date > welding date kontrolü ve renklendirme eklendi
|
||||
- ✅ Seçilen bilgilerin Certificate no ve Heat no'ya yazılması
|
||||
- ✅ RFI tarihine göre sıralama
|
||||
|
||||
### 2. Incoming Control'e Eklenen Yeni Alanlar
|
||||
- ✅ `inspection_photo_file` - Inspection photo dosyaları (10004_Incoming_inspection_Photos/)
|
||||
- ✅ `email_tq_file` - Email/TQ agreement dosyaları (10005_Material_Agreement/)
|
||||
- ✅ `email_tq_number` - Email/TQ takip numarası
|
||||
- ✅ `osd_defect_akt_file` - OSD Defect AKT dosyaları (10003_Defect_Akt/)
|
||||
- ✅ `osd_report_date` - OSD rapor tarihi
|
||||
- ✅ `drawing_number` - Drawing numarası
|
||||
|
||||
### 3. MTO Entegrasyonu
|
||||
- ✅ MTO'dan `drawing_number` sync edildi
|
||||
- ✅ MTO sync işleminde drawing_number dahil edildi
|
||||
|
||||
### 4. Dosya Yükleme Sistemi
|
||||
- ✅ 3 farklı upload alanı eklendi (inspection photo, email/TQ, OSD defect)
|
||||
- ✅ Her biri için ayrı klasör yapısı
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Yeni Task'ta İstenenler
|
||||
|
||||
### ✅ Tamamlanması Gerekenler
|
||||
|
||||
#### 1. **Dosya Klasör Yapısı Değişiklikleri**
|
||||
- ❌ **Material Agreement**: `10005_Material_Agreement/` → `002_Project_Materials/005_Material_Agreement/` olmalı
|
||||
- ❌ **OSD Defect**: `10003_Defect_Akt/` → `002_Project_Materials/006_Defect_Documents/` veya `006_Defect_Akt/` olmalı
|
||||
- ❌ **Inspection Photo**: Kaldırılacak (removed sub-issue)
|
||||
|
||||
#### 2. **PDF Görüntüleme Sistemi**
|
||||
- ❌ Incoming Control ekranına Weldlog'daki gibi sol tarafta PDF görüntüleme alanı eklenmeli
|
||||
- ❌ Yüklenen PDF'ler (Material Agreement ve OSD Defect) bu alanda gösterilmeli
|
||||
- ❌ Sütunlar PDF görüntüleme alanının yanına gelmeli
|
||||
|
||||
#### 3. **Sütun İsimlendirme Değişiklikleri**
|
||||
- ❌ **Drawing**: "Drawing" → "Line" olarak değiştirilmeli
|
||||
- ❌ **Drawing yanına**: "Project" sütunu eklenmeli
|
||||
- ❌ **Email/TQ**: "Email / TQ No" → sadece "TQ" olmalı
|
||||
- ❌ **Zone**: Popup'ta "Zone" olarak gösterilen `project` alanı doğru çalışıyor (değişiklik yok)
|
||||
|
||||
#### 4. **Sum/Avg Hesaplamaları**
|
||||
- ❌ Входящий контроль (Incoming Control) alanında sum/avg gibi hesaplamalar kaldırılmalı
|
||||
|
||||
#### 5. **Yetkilendirme Sistemi**
|
||||
- ❌ Tüm dosya yükleme yetkilendirmeleri `incoming_control_upload_permission` altında toplanmalı
|
||||
- ❌ Special permissions sayfasında düzenleme yapılmalı
|
||||
|
||||
#### 6. **Comments Ekranı Sorunu**
|
||||
- ❌ Weldlog - Weldmap açılır ekran Comments'te hiçbir veri görüntülenmiyor
|
||||
- ❌ Mevcut veriler içinde olmasına rağmen gösterilmiyor
|
||||
|
||||
---
|
||||
|
||||
## 📊 Mevcut Durum Analizi
|
||||
|
||||
### Dosya Yapısı
|
||||
```
|
||||
Mevcut:
|
||||
- 10004_Incoming_inspection_Photos/ (KALDIRILACAK)
|
||||
- 10005_Material_Agreement/ (DEĞİŞTİRİLECEK)
|
||||
- 10003_Defect_Akt/ (DEĞİŞTİRİLECEK)
|
||||
|
||||
Yeni:
|
||||
- 002_Project_Materials/005_Material_Agreement/
|
||||
- 002_Project_Materials/006_Defect_Documents/ (veya 006_Defect_Akt/)
|
||||
```
|
||||
|
||||
### Sütun İsimleri
|
||||
```
|
||||
Mevcut:
|
||||
- "Drawing" → "Line" olmalı
|
||||
- "Email / TQ No" → "TQ" olmalı
|
||||
- "Project" sütunu eklenmeli (Drawing yanına)
|
||||
```
|
||||
|
||||
### PDF Görüntüleme
|
||||
- Weldlog'da PDF görüntüleme sistemi mevcut
|
||||
- Incoming Control'de yok, eklenmeli
|
||||
|
||||
### Sum/Avg Hesaplamaları
|
||||
- `datagrid.blade.php` içinde summary sistemi var
|
||||
- Incoming Control için devre dışı bırakılmalı
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ Implementation Roadmap
|
||||
|
||||
### Phase 1: Dosya Klasör Yapısı ve Upload Değişiklikleri
|
||||
|
||||
#### 1.1. Upload Klasörlerini Güncelle
|
||||
**Dosya:** `resources/views/admin/type/incoming-control.blade.php`
|
||||
|
||||
**Değişiklikler:**
|
||||
- `$thirdUploadFolder` - Inspection Photo kaldırılacak
|
||||
- `$fourthUploadFolder`: `10005_Material_Agreement/` → `002_Project_Materials/005_Material_Agreement/`
|
||||
- `$fifthUploadFolder`: `10003_Defect_Akt/` → `002_Project_Materials/006_Defect_Documents/`
|
||||
|
||||
**Etkilenen Alanlar:**
|
||||
- Upload section HTML
|
||||
- Block groups (inspection_photo_file kaldırılacak)
|
||||
- Relation datas (inspection_photo_file kaldırılacak)
|
||||
|
||||
#### 1.2. Database Migration (Gerekirse)
|
||||
- Eğer mevcut dosyalar taşınacaksa migration gerekebilir
|
||||
- Dosya yollarını güncellemek için script
|
||||
|
||||
---
|
||||
|
||||
### Phase 2: PDF Görüntüleme Sistemi
|
||||
|
||||
#### 2.1. PDF Viewer Component Oluştur
|
||||
**Yeni Dosya:** `resources/views/components/incoming-control-pdf-viewer.blade.php`
|
||||
|
||||
**Özellikler:**
|
||||
- Sol tarafta PDF görüntüleme alanı
|
||||
- Material Agreement ve OSD Defect PDF'lerini gösterme
|
||||
- Weldlog'daki PDF viewer'a benzer yapı
|
||||
|
||||
#### 2.2. Incoming Control Layout'u Güncelle
|
||||
**Dosya:** `resources/views/admin/type/incoming-control.blade.php`
|
||||
|
||||
**Değişiklikler:**
|
||||
- Layout'u iki kolonlu yap (PDF viewer sol, datagrid sağ)
|
||||
- PDF viewer component'ini dahil et
|
||||
- Seçili satırdaki PDF'leri göster
|
||||
|
||||
#### 2.3. JavaScript Entegrasyonu
|
||||
- DataGrid'de satır seçildiğinde PDF'leri yükle
|
||||
- PDF viewer'ı güncelle
|
||||
|
||||
---
|
||||
|
||||
### Phase 3: Sütun İsimlendirme ve Düzenlemeler
|
||||
|
||||
#### 3.1. Incoming Control Ana Ekran
|
||||
**Dosya:** `resources/views/admin/type/incoming-control.blade.php`
|
||||
|
||||
**Değişiklikler:**
|
||||
- Block groups'da `drawing_number` → "Line" olarak göster
|
||||
- `project` alanını "Project" olarak ekle (Drawing yanına)
|
||||
- `email_tq_number` → "TQ" olarak göster
|
||||
|
||||
#### 3.2. Popup Ekranı
|
||||
**Dosya:** `resources/views/components/incoming-control-popup.blade.php`
|
||||
|
||||
**Değişiklikler:**
|
||||
- "Drawing" → "Line" olarak değiştir (satır 220)
|
||||
- "Email / TQ No" → "TQ" olarak değiştir (satır 262)
|
||||
- "Zone" zaten `project` alanını gösteriyor, doğru
|
||||
|
||||
#### 3.3. AJAX Endpoint
|
||||
**Dosya:** `resources/views/admin-ajax/get-incoming-for-weldlog.blade.php`
|
||||
|
||||
**Değişiklikler:**
|
||||
- Response'da field isimleri aynı kalacak (sadece caption'lar değişecek)
|
||||
|
||||
---
|
||||
|
||||
### Phase 4: Sum/Avg Hesaplamalarını Kaldır
|
||||
|
||||
#### 4.1. Incoming Control DataGrid Ayarları
|
||||
**Dosya:** `resources/views/admin/type/incoming-control.blade.php`
|
||||
|
||||
**Değişiklikler:**
|
||||
- `$disableTotalSummary = true;` ekle
|
||||
- Veya `$limitedSummaryColumns = [];` (boş array)
|
||||
|
||||
#### 4.2. Module Block Component
|
||||
**Dosya:** `resources/views/components/blocks/module-block.blade.php`
|
||||
|
||||
**Kontrol:**
|
||||
- Incoming Control için summary'lerin devre dışı olduğundan emin ol
|
||||
|
||||
---
|
||||
|
||||
### Phase 5: Yetkilendirme Sistemi
|
||||
|
||||
#### 5.1. Upload Permission Kontrolü
|
||||
**Dosya:** `resources/views/admin-ajax/document-upload.blade.php`
|
||||
|
||||
**Mevcut Durum:**
|
||||
- `incoming_control_upload_permission` zaten tanımlı (satır 215 incoming-control.blade.php'de)
|
||||
|
||||
**Kontrol:**
|
||||
- Tüm upload işlemlerinde bu permission'ın kullanıldığından emin ol
|
||||
|
||||
#### 5.2. Special Permissions Sayfası
|
||||
**Dosya:** `resources/views/admin/type/settings/specific-permissions.blade.php`
|
||||
|
||||
**Mevcut Durum:**
|
||||
- `incoming_control_upload_permission` zaten "Other Upload Permissions" kategorisinde (satır 39)
|
||||
|
||||
**Kontrol:**
|
||||
- Tüm incoming control upload'ları için tek bir permission kullanıldığından emin ol
|
||||
|
||||
---
|
||||
|
||||
### Phase 6: Comments Ekranı Sorunu
|
||||
|
||||
#### 6.1. Comments Ekranını İncele
|
||||
**Dosya:** `resources/views/admin-ajax/column-history.blade.php`
|
||||
**Dosya:** `resources/views/admin-ajax/row-history.blade.php`
|
||||
|
||||
**Sorun:**
|
||||
- Weldlog/Weldmap Comments ekranında veri görüntülenmiyor
|
||||
|
||||
**Kontrol Edilecekler:**
|
||||
- DataGrid dataSource doğru mu?
|
||||
- AJAX endpoint çalışıyor mu?
|
||||
- Filter/query sorunları var mı?
|
||||
- Table name ve record ID doğru mu?
|
||||
|
||||
#### 6.2. Debug ve Düzeltme
|
||||
- Console log'ları ekle
|
||||
- AJAX response'u kontrol et
|
||||
- DataGrid yapılandırmasını kontrol et
|
||||
|
||||
---
|
||||
|
||||
## 📝 Detaylı Görev Listesi
|
||||
|
||||
### ✅ Yapılacaklar
|
||||
|
||||
1. **Dosya Klasör Yapısı**
|
||||
- [ ] Inspection photo upload'ı kaldır
|
||||
- [ ] Material Agreement klasörünü güncelle
|
||||
- [ ] OSD Defect klasörünü güncelle
|
||||
- [ ] Mevcut dosyaları yeni klasörlere taşı (gerekirse)
|
||||
|
||||
2. **PDF Görüntüleme**
|
||||
- [ ] PDF viewer component oluştur
|
||||
- [ ] Layout'u iki kolonlu yap
|
||||
- [ ] JavaScript entegrasyonu
|
||||
- [ ] Satır seçildiğinde PDF yükleme
|
||||
|
||||
3. **Sütun İsimlendirme**
|
||||
- [ ] Drawing → Line
|
||||
- [ ] Email/TQ → TQ
|
||||
- [ ] Project sütunu ekle
|
||||
- [ ] Popup'ta aynı değişiklikler
|
||||
|
||||
4. **Sum/Avg Kaldırma**
|
||||
- [ ] Incoming Control için summary'leri devre dışı bırak
|
||||
|
||||
5. **Yetkilendirme**
|
||||
- [ ] Tüm upload'ların tek permission kullandığını doğrula
|
||||
|
||||
6. **Comments Sorunu**
|
||||
- [ ] Sorunu tespit et
|
||||
- [ ] Düzelt
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Teknik Detaylar
|
||||
|
||||
### Dosya Yolları
|
||||
```php
|
||||
// Eski
|
||||
$fourthUploadFolder = '10005_Material_Agreement/';
|
||||
$fifthUploadFolder = '10003_Defect_Akt/';
|
||||
|
||||
// Yeni
|
||||
$fourthUploadFolder = '002_Project_Materials/005_Material_Agreement/';
|
||||
$fifthUploadFolder = '002_Project_Materials/006_Defect_Documents/';
|
||||
```
|
||||
|
||||
### Sütun Caption'ları
|
||||
```php
|
||||
// Popup'ta
|
||||
'drawing_number' => 'Line', // Eski: 'Drawing'
|
||||
'email_tq_number' => 'TQ', // Eski: 'Email / TQ No'
|
||||
'project' => 'Project', // Zaten var
|
||||
```
|
||||
|
||||
### PDF Viewer Layout
|
||||
```html
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<!-- PDF Viewer -->
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<!-- DataGrid -->
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Dikkat Edilmesi Gerekenler
|
||||
|
||||
1. **Dosya Taşıma**: Mevcut dosyalar yeni klasörlere taşınırken path'lerin güncellenmesi gerekebilir
|
||||
2. **Backward Compatibility**: Eski path'lerdeki dosyalara erişim sorunları olabilir
|
||||
3. **Database**: `incoming_controls` tablosundaki file path'ler güncellenmeli
|
||||
4. **Permissions**: Upload permission'larının doğru çalıştığından emin ol
|
||||
5. **Comments**: Weldlog/Weldmap comments sorunu ayrı bir issue olabilir
|
||||
|
||||
---
|
||||
|
||||
## 📅 Tahmini Süre
|
||||
|
||||
- **Phase 1**: 2-3 saat (Dosya yapısı değişiklikleri)
|
||||
- **Phase 2**: 4-6 saat (PDF viewer)
|
||||
- **Phase 3**: 1-2 saat (Sütun isimlendirme)
|
||||
- **Phase 4**: 1 saat (Sum/avg kaldırma)
|
||||
- **Phase 5**: 1 saat (Yetkilendirme kontrolü)
|
||||
- **Phase 6**: 2-4 saat (Comments sorunu)
|
||||
|
||||
**Toplam**: 11-17 saat
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Öncelik Sırası
|
||||
|
||||
1. **Yüksek Öncelik**: Sütun isimlendirme, Sum/avg kaldırma
|
||||
2. **Orta Öncelik**: Dosya klasör yapısı, PDF görüntüleme
|
||||
3. **Düşük Öncelik**: Comments sorunu (ayrı issue olabilir)
|
||||
|
||||
---
|
||||
|
||||
## 📚 İlgili Dosyalar
|
||||
|
||||
### Değiştirilecek Dosyalar
|
||||
- `resources/views/admin/type/incoming-control.blade.php`
|
||||
- `resources/views/components/incoming-control-popup.blade.php`
|
||||
- `resources/views/admin-ajax/get-incoming-for-weldlog.blade.php`
|
||||
- `resources/views/components/blocks/module-block.blade.php` (gerekirse)
|
||||
|
||||
### Yeni Oluşturulacak Dosyalar
|
||||
- `resources/views/components/incoming-control-pdf-viewer.blade.php`
|
||||
|
||||
### Kontrol Edilecek Dosyalar
|
||||
- `resources/views/admin-ajax/column-history.blade.php`
|
||||
- `resources/views/admin-ajax/row-history.blade.php`
|
||||
- `resources/views/admin-ajax/document-upload.blade.php`
|
||||
- `resources/views/admin/type/settings/specific-permissions.blade.php`
|
||||
|
||||
---
|
||||
|
||||
## ✅ Test Senaryoları
|
||||
|
||||
1. **Dosya Yükleme**
|
||||
- Material Agreement dosyası yükle → `002_Project_Materials/005_Material_Agreement/` klasörüne gitmeli
|
||||
- OSD Defect dosyası yükle → `002_Project_Materials/006_Defect_Documents/` klasörüne gitmeli
|
||||
|
||||
2. **PDF Görüntüleme**
|
||||
- Satır seç → PDF viewer'da gösterilmeli
|
||||
- Material Agreement PDF'i gösterilmeli
|
||||
- OSD Defect PDF'i gösterilmeli
|
||||
|
||||
3. **Sütun İsimleri**
|
||||
- Ana ekranda "Line" görünmeli (Drawing değil)
|
||||
- "TQ" görünmeli (Email / TQ No değil)
|
||||
- "Project" sütunu görünmeli
|
||||
- Popup'ta aynı isimler görünmeli
|
||||
|
||||
4. **Sum/Avg**
|
||||
- Incoming Control'de sum/avg hesaplamaları görünmemeli
|
||||
|
||||
5. **Yetkilendirme**
|
||||
- Upload permission kontrolü çalışmalı
|
||||
- İzin olmayan kullanıcı upload yapamamalı
|
||||
|
||||
6. **Comments**
|
||||
- Weldlog/Weldmap Comments ekranında veriler görünmeli
|
||||
|
||||
---
|
||||
|
||||
## 📝 Notlar
|
||||
|
||||
- Inspection photo alanı tamamen kaldırılacak (removed sub-issue)
|
||||
- Material Agreement ve OSD Defect aynı klasör yapısı altında olacak (`002_Project_Materials/`)
|
||||
- PDF görüntüleme Weldlog'daki gibi sol tarafta olacak
|
||||
- Tüm değişiklikler backward compatible olmalı (mümkünse)
|
||||
@@ -1,247 +0,0 @@
|
||||
# Incoming Control User Guide
|
||||
|
||||
## What is Incoming Control?
|
||||
|
||||
Incoming Control is your material inspection tracker. Every piece of pipe, fitting, or component that arrives on site must be checked and approved before use. This module helps you document these inspections and maintain quality standards.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Incoming Control:
|
||||
1. Login to the system
|
||||
2. Click on **QC** in the main menu
|
||||
3. Select **Incoming Control** from the submenu
|
||||
|
||||
## Receiving Materials
|
||||
|
||||
### Creating a New Inspection Record
|
||||
1. Click **"Add New"** (+ button) when materials arrive
|
||||
2. Start with these essential fields:
|
||||
- **Purchase Order**: Enter PO number from delivery documents
|
||||
- **Component Code**: Scan or enter the material code
|
||||
- **Heat Number**: From material certificate (very important!)
|
||||
- **Delivery Date**: When materials arrived on site
|
||||
|
||||
### Material Information
|
||||
**Component Details:**
|
||||
- **Description**: What type of component (pipe, elbow, tee, etc.)
|
||||
- **Size**: Diameter and wall thickness
|
||||
- **Grade**: Material specification (A106, A234, etc.)
|
||||
- **Quantity**: How many pieces received
|
||||
|
||||
**Supplier Information:**
|
||||
- **Supplier Name**: Who delivered the materials
|
||||
- **Certificate Number**: Material test certificate reference
|
||||
- **Mill Certificate**: Attach PDF if available
|
||||
|
||||
## Inspection Process
|
||||
|
||||
### Visual Inspection
|
||||
1. **Surface Condition**: Check for damage, rust, dents
|
||||
2. **Dimensional Check**: Verify sizes match specifications
|
||||
3. **Marking Verification**: Confirm heat numbers are clear
|
||||
4. **Documentation**: Ensure certificates are complete
|
||||
|
||||
### Recording Results
|
||||
**Inspection Status Options:**
|
||||
- **✅ ACCEPTED**: Materials passed all checks
|
||||
- **❌ REJECTED**: Failed inspection, cannot use
|
||||
- **⚠️ CONDITIONAL**: Passed with minor notes
|
||||
- **🔄 PENDING**: Inspection in progress
|
||||
|
||||
### Adding Comments
|
||||
Always add notes for:
|
||||
- Any defects found
|
||||
- Special handling requirements
|
||||
- Storage location assigned
|
||||
- Follow-up actions needed
|
||||
|
||||
## Quality Documentation
|
||||
|
||||
### Uploading Certificates
|
||||
1. Click **"Upload"** button in the record
|
||||
2. **Material Certificates**: Add mill test certificates
|
||||
3. **Inspection Reports**: Upload third-party inspection results
|
||||
4. **Photos**: Document any issues or special conditions
|
||||
|
||||
### Certificate Verification
|
||||
Check that certificates include:
|
||||
- ✅ Heat number matches material marking
|
||||
- ✅ Chemical composition within spec
|
||||
- ✅ Mechanical properties acceptable
|
||||
- ✅ Authorized signatures present
|
||||
|
||||
## Storage and Tracking
|
||||
|
||||
### Location Assignment
|
||||
1. **Storage Area**: Assign specific location (Yard A, Rack 5, etc.)
|
||||
2. **Segregation**: Keep different grades separated
|
||||
3. **Protection**: Note weather protection requirements
|
||||
4. **Access**: Mark if special handling needed
|
||||
|
||||
### Inventory Management
|
||||
- **Stock Levels**: Track quantity on hand
|
||||
- **Usage Updates**: Reduce count as materials are issued
|
||||
- **Reservation**: Mark materials for specific work packages
|
||||
- **Transfers**: Document movement between locations
|
||||
|
||||
## Common Tasks
|
||||
|
||||
### Daily Material Receipts
|
||||
1. **Check delivery schedule** for expected arrivals
|
||||
2. **Prepare inspection workspace** and tools
|
||||
3. **Review PO requirements** before inspection
|
||||
4. **Complete inspections** before accepting delivery
|
||||
5. **Update storage inventory** same day
|
||||
|
||||
### Finding Materials
|
||||
**By Heat Number:**
|
||||
1. Use heat number search box
|
||||
2. Enter full or partial number
|
||||
3. View all related materials
|
||||
|
||||
**By Component Type:**
|
||||
1. Filter by component code
|
||||
2. Select size range if needed
|
||||
3. Check availability status
|
||||
|
||||
**By Project Area:**
|
||||
1. Filter by work package
|
||||
2. Review allocated vs available
|
||||
3. Plan material movements
|
||||
|
||||
### Generating Reports
|
||||
**Inspection Summary:**
|
||||
1. Set date range for report period
|
||||
2. Select inspection status filter
|
||||
3. Export to Excel for analysis
|
||||
|
||||
**Certificate Status:**
|
||||
1. Filter for missing certificates
|
||||
2. Follow up with suppliers
|
||||
3. Track compliance percentage
|
||||
|
||||
## Working with Suppliers
|
||||
|
||||
### Communication
|
||||
**For Missing Certificates:**
|
||||
1. Note requirement in comments
|
||||
2. Set follow-up reminder
|
||||
3. Contact procurement team
|
||||
4. Update status when received
|
||||
|
||||
**For Quality Issues:**
|
||||
1. Document problem clearly
|
||||
2. Take photos if applicable
|
||||
3. Contact supplier immediately
|
||||
4. Issue Non-Conformance Report if needed
|
||||
|
||||
### Supplier Performance
|
||||
Track suppliers on:
|
||||
- Certificate completeness
|
||||
- On-time delivery
|
||||
- Quality of materials
|
||||
- Responsiveness to issues
|
||||
|
||||
## Mobile Inspection
|
||||
|
||||
### Using Tablets/Phones
|
||||
- **Camera function** for quick photos
|
||||
- **Barcode scanning** for component codes
|
||||
- **Voice notes** for inspection comments
|
||||
- **Offline capability** for remote locations
|
||||
|
||||
### Field Tips
|
||||
- ✅ Clean components before inspection
|
||||
- ✅ Use good lighting for defect detection
|
||||
- ✅ Have measuring tools ready
|
||||
- ✅ Keep certificates dry and legible
|
||||
|
||||
## Integration with Other Modules
|
||||
|
||||
### Link to Weldmap
|
||||
- Materials flow into welding records
|
||||
- Heat numbers track through to final welds
|
||||
- Quality issues trigger hold notifications
|
||||
|
||||
### Purchasing Coordination
|
||||
- PO status updates automatically
|
||||
- Delivery confirmations sent to procurement
|
||||
- Invoice approval triggered by acceptance
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Can't find material record:**
|
||||
- Check spelling of heat number
|
||||
- Try partial searches
|
||||
- Verify correct project selected
|
||||
- Contact admin if still missing
|
||||
|
||||
**Certificate upload failed:**
|
||||
- Check file size (max 10MB)
|
||||
- Ensure PDF format
|
||||
- Try different browser
|
||||
- Contact IT if persistent
|
||||
|
||||
**Inventory doesn't match:**
|
||||
- Check for unreported usage
|
||||
- Verify transfer records
|
||||
- Look for data entry errors
|
||||
- Perform physical recount
|
||||
|
||||
### Quick Solutions
|
||||
- **Refresh page** for display updates
|
||||
- **Clear filters** if results seem wrong
|
||||
- **Check user permissions** for edit access
|
||||
- **Contact supervisor** for process questions
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Daily Operations
|
||||
- ✅ Inspect materials immediately upon arrival
|
||||
- ✅ Upload certificates same day
|
||||
- ✅ Update storage locations accurately
|
||||
- ✅ Report quality issues promptly
|
||||
|
||||
### Documentation Standards
|
||||
- ✅ Use clear, consistent descriptions
|
||||
- ✅ Include all required measurements
|
||||
- ✅ Photograph any defects
|
||||
- ✅ Keep certificates organized
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Double-check heat number entry
|
||||
- ✅ Verify certificate authenticity
|
||||
- ✅ Follow project specifications exactly
|
||||
- ✅ Escalate questionable materials
|
||||
|
||||
## Safety Reminders
|
||||
|
||||
⚠️ **Always follow safety procedures during inspection**
|
||||
- Wear required PPE
|
||||
- Use proper lifting techniques
|
||||
- Watch for sharp edges
|
||||
- Report unsafe conditions
|
||||
|
||||
🔒 **Security considerations**
|
||||
- Lock storage areas when unattended
|
||||
- Track high-value materials closely
|
||||
- Report any theft or damage immediately
|
||||
- Follow site security protocols
|
||||
|
||||
## Getting Help
|
||||
|
||||
**For Inspection Questions:**
|
||||
- Review material specifications
|
||||
- Consult quality control supervisor
|
||||
- Check industry standards
|
||||
- Ask experienced inspectors
|
||||
|
||||
**For System Issues:**
|
||||
- Try basic troubleshooting first
|
||||
- Document error messages
|
||||
- Contact IT support
|
||||
- Have record details ready
|
||||
|
||||
Remember: Quality starts with incoming materials. Take time to do thorough inspections - it prevents problems later in construction!
|
||||
@@ -1,35 +0,0 @@
|
||||
# Inspection History - Special Modules Guide
|
||||
|
||||
Some modules, like `spool-area-release`, do not define their columns in the standard `$blockGroup` array within their blade file. This causes the "Get Columns" feature in Inspection History Management to return "No specific columns found".
|
||||
|
||||
To support these modules, we must manually define their columns in logic.
|
||||
|
||||
## How to Add a Special Module
|
||||
|
||||
1. Open `resources/views/admin/type/settings/inspection-history-management.blade.php`.
|
||||
2. Locate the `getModuleColumns($slug)` function.
|
||||
3. Add a check for your module slug at the beginning of the function.
|
||||
4. Return an array of column names available in that module.
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
function getModuleColumns($slug) {
|
||||
if (!$slug) return [];
|
||||
|
||||
// Special handling for Spool Area / Release
|
||||
if ($slug === 'spool-area-release') {
|
||||
return [
|
||||
'spool_zone',
|
||||
'project',
|
||||
'iso_number',
|
||||
// ... add all relevant columns
|
||||
];
|
||||
}
|
||||
|
||||
// ... standard parsing logic
|
||||
}
|
||||
```
|
||||
|
||||
## Why is this necessary?
|
||||
The standard parsing parser reads the `$blockGroup` array from the module's blade file (`resources/views/admin/type/{slug}.blade.php`). Specialized modules often build their grids dynamically using JavaScript or custom queries (`weld_logs` table), bypassing the standard `$blockGroup` definition.
|
||||
@@ -1,651 +0,0 @@
|
||||
# isNowAuth Logging System Guide / isNowAuth Loglama Sistemi Kılavuzu
|
||||
|
||||
## What This Logging System Does / Bu Loglama Sistemi Ne Yapar
|
||||
|
||||
### English
|
||||
|
||||
**Purpose and Importance:**
|
||||
|
||||
This logging system provides complete transparency into the authorization decision-making process for weld log updates. Every step of the validation process is recorded, allowing developers and administrators to:
|
||||
|
||||
- **Understand Why Updates Are Blocked or Allowed**: When a user tries to update a weld log and the system blocks it, logs show exactly which rule prevented the update
|
||||
- **Track User Actions**: See who attempted to update what data, when, and what the outcome was
|
||||
- **Debug Authorization Issues**: Quickly identify if a problem is related to welder field restrictions, time limits, or user permission levels
|
||||
- **Audit Trail**: Maintain a complete history of all authorization checks for compliance and security purposes
|
||||
- **Performance Monitoring**: Identify if authorization checks are taking too long or causing bottlenecks
|
||||
|
||||
**What Gets Logged:**
|
||||
|
||||
- Every authorization check attempt with request details
|
||||
- Current database values vs. requested new values
|
||||
- Field-by-field analysis of what's being updated
|
||||
- User information (ID, level, permissions)
|
||||
- Time calculations and limit comparisons
|
||||
- The final decision (allow/deny) with clear reasoning
|
||||
- Special cases like real_welder updates and level-based exceptions
|
||||
|
||||
**Who Should Use These Logs:**
|
||||
|
||||
- **Developers**: For debugging authorization logic and understanding system behavior
|
||||
- **System Administrators**: For troubleshooting user complaints about blocked updates
|
||||
- **QA Engineers**: For verifying that authorization rules work as expected
|
||||
- **Compliance Officers**: For auditing data modification attempts
|
||||
- **Support Teams**: For explaining to users why their update was rejected
|
||||
|
||||
**When to Check These Logs:**
|
||||
|
||||
- When users report they cannot update weld logs
|
||||
- When investigating suspicious or unauthorized update attempts
|
||||
- When testing new authorization rules or modifications
|
||||
- When debugging time limit issues
|
||||
- When validating that welder field protections are working correctly
|
||||
|
||||
---
|
||||
|
||||
### Türkçe
|
||||
|
||||
**Amaç ve Önemi:**
|
||||
|
||||
Bu loglama sistemi, kaynak kaydı güncellemeleri için yetkilendirme karar verme sürecinde tam şeffaflık sağlar. Doğrulama sürecinin her adımı kaydedilir ve geliştiriciler ile yöneticilerin şunları yapmasına olanak tanır:
|
||||
|
||||
- **Güncellemelerin Neden Engellendiğini veya İzin Verildiğini Anlamak**: Bir kullanıcı kaynak kaydını güncellemeye çalıştığında ve sistem engellediğinde, loglar hangi kuralın güncellemeyi engellediğini tam olarak gösterir
|
||||
- **Kullanıcı Eylemlerini Takip Etmek**: Kimin, hangi veriyi, ne zaman güncellemeye çalıştığını ve sonucun ne olduğunu görmek
|
||||
- **Yetkilendirme Sorunlarını Gidermek**: Bir sorunun kaynakçı alanı kısıtlamaları, zaman limitleri veya kullanıcı yetki seviyeleriyle ilgili olup olmadığını hızlıca belirlemek
|
||||
- **Denetim İzi**: Uyumluluk ve güvenlik amaçları için tüm yetkilendirme kontrollerinin tam geçmişini tutmak
|
||||
- **Performans İzleme**: Yetkilendirme kontrollerinin çok uzun sürdüğünü veya darboğazlara neden olduğunu tespit etmek
|
||||
|
||||
**Neler Loglanır:**
|
||||
|
||||
- Her yetkilendirme kontrol denemesi ile istek detayları
|
||||
- Mevcut veritabanı değerleri ile istenen yeni değerlerin karşılaştırması
|
||||
- Neyin güncellendiğinin alan bazında analizi
|
||||
- Kullanıcı bilgileri (ID, seviye, yetkiler)
|
||||
- Zaman hesaplamaları ve limit karşılaştırmaları
|
||||
- Net gerekçesiyle birlikte final karar (izin ver/engelle)
|
||||
- real_welder güncellemeleri ve seviye bazlı istisnalar gibi özel durumlar
|
||||
|
||||
**Bu Logları Kimler Kullanmalı:**
|
||||
|
||||
- **Geliştiriciler**: Yetkilendirme mantığını debug etmek ve sistem davranışını anlamak için
|
||||
- **Sistem Yöneticileri**: Engellenen güncellemeler hakkında kullanıcı şikayetlerini gidermek için
|
||||
- **QA Mühendisleri**: Yetkilendirme kurallarının beklendiği gibi çalıştığını doğrulamak için
|
||||
- **Uyumluluk Görevlileri**: Veri değiştirme denemelerini denetlemek için
|
||||
- **Destek Ekipleri**: Kullanıcılara neden güncellemelerinin reddedildiğini açıklamak için
|
||||
|
||||
**Bu Loglar Ne Zaman Kontrol Edilmeli:**
|
||||
|
||||
- Kullanıcılar kaynak kayıtlarını güncelleyemediklerini bildirdiğinde
|
||||
- Şüpheli veya yetkisiz güncelleme denemelerini araştırırken
|
||||
- Yeni yetkilendirme kurallarını veya değişiklikleri test ederken
|
||||
- Zaman limiti sorunlarını debug ederken
|
||||
- Kaynakçı alanı korumalarının doğru çalıştığını doğrularken
|
||||
|
||||
---
|
||||
|
||||
## English Version
|
||||
|
||||
### Overview
|
||||
|
||||
The `isNowAuth` function in `AdminController.php` is responsible for authorization checks when updating weld log records. This guide explains the comprehensive logging system implemented for debugging and monitoring purposes.
|
||||
|
||||
### Log Key Structure
|
||||
|
||||
All logs follow a standardized key format:
|
||||
```
|
||||
{function_name}.{section}.{detail}
|
||||
```
|
||||
|
||||
This hierarchical structure makes it easy to filter and trace specific operations.
|
||||
|
||||
### Main Functions and Their Logs
|
||||
|
||||
#### 1. isNowAuth Function
|
||||
|
||||
The primary authorization function that checks various conditions before allowing weld log updates.
|
||||
|
||||
##### Log Keys:
|
||||
|
||||
**`isNowAuth.start`**
|
||||
- **Purpose**: Log the initial request parameters
|
||||
- **Data Logged**:
|
||||
- `table_name`: The target table name
|
||||
- `request_key`: The primary key of the record being updated
|
||||
- `request_values`: The new values to be updated
|
||||
- **When**: At the very beginning of the function
|
||||
- **Example**:
|
||||
```json
|
||||
{
|
||||
"table_name": "weld_logs",
|
||||
"request_key": {"id": 123},
|
||||
"request_values": {"welder_1": "JOHN", "welder_2": "MIKE"}
|
||||
}
|
||||
```
|
||||
|
||||
**`isNowAuth.query.result`**
|
||||
- **Purpose**: Log the database query result
|
||||
- **Data Logged**:
|
||||
- `query_found`: Boolean indicating if record was found
|
||||
- `query_id`: The ID of the found record
|
||||
- **When**: After querying the database for the existing record
|
||||
|
||||
**`isNowAuth.welder_check.existing_values`**
|
||||
- **Purpose**: Log current welder field values from database
|
||||
- **Data Logged**:
|
||||
- `welder_1`: Current welder_1 value
|
||||
- `welder_2`: Current welder_2 value
|
||||
- `welder_1_empty`: Boolean check if welder_1 is empty
|
||||
- `welder_2_empty`: Boolean check if welder_2 is empty
|
||||
- **When**: When checking welder fields in existing record
|
||||
|
||||
**`isNowAuth.welder_check.new_values`**
|
||||
- **Purpose**: Log the new welder values from the update request
|
||||
- **Data Logged**:
|
||||
- `welder_1_isset`: Boolean check if welder_1 is in update
|
||||
- `welder_2_isset`: Boolean check if welder_2 is in update
|
||||
- `welder_1`: New welder_1 value (if any)
|
||||
- `welder_2`: New welder_2 value (if any)
|
||||
- **When**: When processing new values from the request
|
||||
|
||||
**`isNowAuth.welder_check.blocked`**
|
||||
- **Purpose**: Log when a welder field update is blocked
|
||||
- **Data Logged**:
|
||||
- `reason`: Why it was blocked (e.g., "welder_1_already_filled")
|
||||
- `existing_value`: The current value in database
|
||||
- `new_value`: The attempted new value
|
||||
- **When**: When trying to update a welder field that's already filled
|
||||
- **Action**: Returns false (blocks the update)
|
||||
|
||||
**`isNowAuth.real_welder_check.status`**
|
||||
- **Purpose**: Log whether only real_welder fields are being updated
|
||||
- **Data Logged**:
|
||||
- `is_only_real_welder_update`: Boolean result
|
||||
- **When**: After checking if the update is only for real_welder_1 or real_welder_2
|
||||
|
||||
**`isNowAuth.real_welder_check.welder_status`**
|
||||
- **Purpose**: Log welder field status for real_welder updates
|
||||
- **Data Logged**:
|
||||
- `welder_1_value`: Current welder_1 value
|
||||
- `welder_2_value`: Current welder_2 value
|
||||
- `welder_fields_filled`: Boolean if any welder field is filled
|
||||
- **When**: During real_welder update validation
|
||||
|
||||
**`isNowAuth.real_welder_check.decision`**
|
||||
- **Purpose**: Log the decision for real_welder updates
|
||||
- **Data Logged**:
|
||||
- `action`: "allow_without_time_limit" or "continue_to_time_check"
|
||||
- `reason`: "welder_fields_empty" or "welder_fields_filled"
|
||||
- **When**: After deciding whether to bypass time limit for real_welder updates
|
||||
|
||||
**`isNowAuth.level_check.status`**
|
||||
- **Purpose**: Log user level check status
|
||||
- **Data Logged**:
|
||||
- `user_id`: Current user's ID
|
||||
- `user_level`: Current user's level
|
||||
- `allowed_levels`: Array of levels that bypass time limit
|
||||
- `level_in_allowed`: Boolean if user is in exception list
|
||||
- **When**: Checking if user level has special privileges
|
||||
|
||||
**`isNowAuth.level_check.decision`**
|
||||
- **Purpose**: Log decision based on user level
|
||||
- **Data Logged**:
|
||||
- `action`: "allow"
|
||||
- `reason`: "user_level_in_exception_list"
|
||||
- `user_level`: The user's level
|
||||
- **When**: When user level grants exception from time limit
|
||||
- **Action**: Returns true (allows the update)
|
||||
|
||||
**`isNowAuth.time_limit_check.initiating`**
|
||||
- **Purpose**: Log when time limit check is about to be performed
|
||||
- **Data Logged**:
|
||||
- `user_level`: User's level
|
||||
- `welding_date`: The welding date from record
|
||||
- `created_at`: Record creation timestamp
|
||||
- **When**: Before calling checkWeldLogTimeLimit function
|
||||
|
||||
**`isNowAuth.decision`**
|
||||
- **Purpose**: Log final authorization decisions
|
||||
- **Data Logged**:
|
||||
- `action`: "allow" or "deny"
|
||||
- `reason`: Description of why decision was made
|
||||
- **When**: Various exit points of the function
|
||||
- **Possible Reasons**:
|
||||
- "welding_date_empty": No welding date, update allowed
|
||||
- "not_weld_logs_table": Different table, no special rules
|
||||
|
||||
#### 2. isOnlyRealWelderFieldsUpdate Function
|
||||
|
||||
Helper function to determine if only real_welder fields are being updated.
|
||||
|
||||
##### Log Keys:
|
||||
|
||||
**`isOnlyRealWelderFieldsUpdate.analysis`**
|
||||
- **Purpose**: Log detailed analysis of fields being updated
|
||||
- **Data Logged**:
|
||||
- `updating_fields`: Array of all fields being updated
|
||||
- `has_real_welder_update`: Boolean if any real_welder field is included
|
||||
- `other_fields`: Array of non-real_welder fields being updated
|
||||
- `is_only_real_welder_update`: Boolean final result
|
||||
- `real_welder_field_values`: Object with real_welder_1 and real_welder_2 values
|
||||
- **When**: Every time this function is called
|
||||
- **Example**:
|
||||
```json
|
||||
{
|
||||
"updating_fields": ["real_welder_1", "real_welder_2"],
|
||||
"has_real_welder_update": true,
|
||||
"other_fields": [],
|
||||
"is_only_real_welder_update": true,
|
||||
"real_welder_field_values": {
|
||||
"real_welder_1": "JOHN",
|
||||
"real_welder_2": "MIKE"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### 3. checkWeldLogTimeLimit Function
|
||||
|
||||
Validates if the update is within the allowed time limit.
|
||||
|
||||
##### Log Keys:
|
||||
|
||||
**`checkWeldLogTimeLimit.start`**
|
||||
- **Purpose**: Log function initialization
|
||||
- **Data Logged**:
|
||||
- `query_id`: Record ID being checked
|
||||
- `created_at`: Record creation timestamp
|
||||
- `created_at_is_null`: Boolean check
|
||||
- **When**: At function start
|
||||
|
||||
**`checkWeldLogTimeLimit.calculation`**
|
||||
- **Purpose**: Log time difference calculations
|
||||
- **Data Logged**:
|
||||
- `created_at`: Record creation time
|
||||
- `current_time`: Current timestamp
|
||||
- `allowed_hour_limit`: Maximum hours allowed from settings
|
||||
- `actual_hour_difference`: Calculated hour difference
|
||||
- `within_limit`: Boolean if within allowed time
|
||||
- **When**: After calculating time differences
|
||||
- **Example**:
|
||||
```json
|
||||
{
|
||||
"created_at": "2024-10-16 08:00:00",
|
||||
"current_time": "2024-10-16 10:30:00",
|
||||
"allowed_hour_limit": 4,
|
||||
"actual_hour_difference": 2.5,
|
||||
"within_limit": true
|
||||
}
|
||||
```
|
||||
|
||||
**`checkWeldLogTimeLimit.decision`**
|
||||
- **Purpose**: Log the final time limit decision
|
||||
- **Data Logged**:
|
||||
- `action`: "allow" or "deny"
|
||||
- `reason`: Explanation of decision
|
||||
- `hour_difference`: Actual hours passed (for allow)
|
||||
- `allowed_limit`: Maximum allowed hours (for allow)
|
||||
- `exceeded_by`: Hours over the limit (for deny only)
|
||||
- **When**: Before returning the decision
|
||||
- **Possible Reasons**:
|
||||
- "within_time_limit": Update allowed
|
||||
- "exceeded_time_limit": Update blocked
|
||||
- "created_at_is_null": No creation date, blocked
|
||||
|
||||
### How to Use These Logs for Debugging
|
||||
|
||||
#### 1. Monitor All isNowAuth Operations
|
||||
```bash
|
||||
tail -f storage/logs/laravel.log | grep "isNowAuth"
|
||||
```
|
||||
|
||||
#### 2. Track Specific Authorization Failures
|
||||
```bash
|
||||
tail -f storage/logs/laravel.log | grep "isNowAuth.welder_check.blocked"
|
||||
```
|
||||
|
||||
#### 3. Monitor Time Limit Violations
|
||||
```bash
|
||||
tail -f storage/logs/laravel.log | grep "checkWeldLogTimeLimit.decision" | grep "deny"
|
||||
```
|
||||
|
||||
#### 4. Track Real Welder Updates
|
||||
```bash
|
||||
tail -f storage/logs/laravel.log | grep "isNowAuth.real_welder_check"
|
||||
```
|
||||
|
||||
#### 5. Monitor User Level Exceptions
|
||||
```bash
|
||||
tail -f storage/logs/laravel.log | grep "isNowAuth.level_check"
|
||||
```
|
||||
|
||||
### Common Debugging Scenarios
|
||||
|
||||
#### Scenario 1: Update is Blocked - Find Out Why
|
||||
|
||||
1. Search for the record ID in logs:
|
||||
```bash
|
||||
grep "query_id.*123" storage/logs/laravel.log | grep isNowAuth
|
||||
```
|
||||
|
||||
2. Look for decision logs:
|
||||
```bash
|
||||
grep "isNowAuth.decision\|isNowAuth.welder_check.blocked" storage/logs/laravel.log
|
||||
```
|
||||
|
||||
#### Scenario 2: Time Limit Issues
|
||||
|
||||
1. Check time calculations:
|
||||
```bash
|
||||
grep "checkWeldLogTimeLimit.calculation" storage/logs/laravel.log | tail -1
|
||||
```
|
||||
|
||||
2. Review the decision:
|
||||
```bash
|
||||
grep "checkWeldLogTimeLimit.decision" storage/logs/laravel.log | tail -1
|
||||
```
|
||||
|
||||
#### Scenario 3: Real Welder Update Problems
|
||||
|
||||
1. Check if it's recognized as real_welder only update:
|
||||
```bash
|
||||
grep "isOnlyRealWelderFieldsUpdate.analysis" storage/logs/laravel.log | tail -1
|
||||
```
|
||||
|
||||
2. Check the welder field status:
|
||||
```bash
|
||||
grep "isNowAuth.real_welder_check.welder_status" storage/logs/laravel.log | tail -1
|
||||
```
|
||||
|
||||
### Log Levels
|
||||
|
||||
All logs use `Log::debug()` which means:
|
||||
- They appear in the log file only when `APP_DEBUG=true` in `.env`
|
||||
- They don't appear in production by default (for performance)
|
||||
- They use the "DEBUG" level in log entries
|
||||
|
||||
### Best Practices
|
||||
|
||||
1. **Always check logs in sequence**: Follow the flow from `isNowAuth.start` to final decision
|
||||
2. **Use grep with context**: Add `-A 5 -B 5` to see surrounding logs
|
||||
3. **Filter by timestamp**: When debugging specific issues, filter by time range
|
||||
4. **Save important log sections**: Export relevant logs for documentation
|
||||
5. **Monitor production carefully**: Only enable debug logs temporarily in production
|
||||
|
||||
### Performance Considerations
|
||||
|
||||
- Debug logs are only written when `APP_DEBUG=true`
|
||||
- Each authorization check generates 5-15 log entries
|
||||
- Log file rotation should be configured properly
|
||||
- Consider using log analysis tools for high-volume systems
|
||||
|
||||
---
|
||||
|
||||
## Türkçe Versiyon
|
||||
|
||||
### Genel Bakış
|
||||
|
||||
`AdminController.php` dosyasındaki `isNowAuth` fonksiyonu, kaynak kaydı güncellenirken yetkilendirme kontrollerinden sorumludur. Bu kılavuz, hata ayıklama ve izleme amaçlı olarak uygulanan kapsamlı loglama sistemini açıklar.
|
||||
|
||||
### Log Anahtar Yapısı
|
||||
|
||||
Tüm loglar standart bir anahtar formatı takip eder:
|
||||
```
|
||||
{fonksiyon_adi}.{bolum}.{detay}
|
||||
```
|
||||
|
||||
Bu hiyerarşik yapı, belirli işlemleri filtrelemeyi ve izlemeyi kolaylaştırır.
|
||||
|
||||
### Ana Fonksiyonlar ve Logları
|
||||
|
||||
#### 1. isNowAuth Fonksiyonu
|
||||
|
||||
Kaynak kaydı güncellemelerine izin vermeden önce çeşitli koşulları kontrol eden birincil yetkilendirme fonksiyonu.
|
||||
|
||||
##### Log Anahtarları:
|
||||
|
||||
**`isNowAuth.start`**
|
||||
- **Amaç**: Başlangıç istek parametrelerini logla
|
||||
- **Loglanan Veriler**:
|
||||
- `table_name`: Hedef tablo adı
|
||||
- `request_key`: Güncellenen kaydın birincil anahtarı
|
||||
- `request_values`: Güncellenecek yeni değerler
|
||||
- **Ne Zaman**: Fonksiyonun en başında
|
||||
- **Örnek**:
|
||||
```json
|
||||
{
|
||||
"table_name": "weld_logs",
|
||||
"request_key": {"id": 123},
|
||||
"request_values": {"welder_1": "JOHN", "welder_2": "MIKE"}
|
||||
}
|
||||
```
|
||||
|
||||
**`isNowAuth.query.result`**
|
||||
- **Amaç**: Veritabanı sorgu sonucunu logla
|
||||
- **Loglanan Veriler**:
|
||||
- `query_found`: Kayıt bulunup bulunmadığını gösteren boolean
|
||||
- `query_id`: Bulunan kaydın ID'si
|
||||
- **Ne Zaman**: Mevcut kayıt için veritabanı sorgulandıktan sonra
|
||||
|
||||
**`isNowAuth.welder_check.existing_values`**
|
||||
- **Amaç**: Veritabanındaki mevcut kaynakçı alan değerlerini logla
|
||||
- **Loglanan Veriler**:
|
||||
- `welder_1`: Mevcut welder_1 değeri
|
||||
- `welder_2`: Mevcut welder_2 değeri
|
||||
- `welder_1_empty`: welder_1'in boş olup olmadığını gösteren boolean
|
||||
- `welder_2_empty`: welder_2'nin boş olup olmadığını gösteren boolean
|
||||
- **Ne Zaman**: Mevcut kayıttaki kaynakçı alanları kontrol edilirken
|
||||
|
||||
**`isNowAuth.welder_check.new_values`**
|
||||
- **Amaç**: Güncelleme isteğindeki yeni kaynakçı değerlerini logla
|
||||
- **Loglanan Veriler**:
|
||||
- `welder_1_isset`: welder_1'in güncellemede olup olmadığını gösteren boolean
|
||||
- `welder_2_isset`: welder_2'nin güncellemede olup olmadığını gösteren boolean
|
||||
- `welder_1`: Yeni welder_1 değeri (varsa)
|
||||
- `welder_2`: Yeni welder_2 değeri (varsa)
|
||||
- **Ne Zaman**: İstekten yeni değerler işlenirken
|
||||
|
||||
**`isNowAuth.welder_check.blocked`**
|
||||
- **Amaç**: Kaynakçı alanı güncellemesi engellendiğinde logla
|
||||
- **Loglanan Veriler**:
|
||||
- `reason`: Neden engellendiği (örn: "welder_1_already_filled")
|
||||
- `existing_value`: Veritabanındaki mevcut değer
|
||||
- `new_value`: Denenen yeni değer
|
||||
- **Ne Zaman**: Zaten dolu olan bir kaynakçı alanı güncellenmeye çalışıldığında
|
||||
- **Aksiyon**: false döner (güncellemeyi engeller)
|
||||
|
||||
**`isNowAuth.real_welder_check.status`**
|
||||
- **Amaç**: Sadece real_welder alanlarının güncellenip güncellenmediğini logla
|
||||
- **Loglanan Veriler**:
|
||||
- `is_only_real_welder_update`: Boolean sonuç
|
||||
- **Ne Zaman**: Güncellemenin sadece real_welder_1 veya real_welder_2 için olup olmadığı kontrol edildikten sonra
|
||||
|
||||
**`isNowAuth.real_welder_check.welder_status`**
|
||||
- **Amaç**: real_welder güncellemeleri için kaynakçı alan durumunu logla
|
||||
- **Loglanan Veriler**:
|
||||
- `welder_1_value`: Mevcut welder_1 değeri
|
||||
- `welder_2_value`: Mevcut welder_2 değeri
|
||||
- `welder_fields_filled`: Herhangi bir kaynakçı alanının dolu olup olmadığını gösteren boolean
|
||||
- **Ne Zaman**: real_welder güncelleme doğrulaması sırasında
|
||||
|
||||
**`isNowAuth.real_welder_check.decision`**
|
||||
- **Amaç**: real_welder güncellemeleri için kararı logla
|
||||
- **Loglanan Veriler**:
|
||||
- `action`: "allow_without_time_limit" veya "continue_to_time_check"
|
||||
- `reason`: "welder_fields_empty" veya "welder_fields_filled"
|
||||
- **Ne Zaman**: real_welder güncellemeleri için zaman limitini atlayıp atlamayacağına karar verildikten sonra
|
||||
|
||||
**`isNowAuth.level_check.status`**
|
||||
- **Amaç**: Kullanıcı seviye kontrol durumunu logla
|
||||
- **Loglanan Veriler**:
|
||||
- `user_id`: Mevcut kullanıcının ID'si
|
||||
- `user_level`: Mevcut kullanıcının seviyesi
|
||||
- `allowed_levels`: Zaman limitini atlayan seviyelerin dizisi
|
||||
- `level_in_allowed`: Kullanıcının istisna listesinde olup olmadığını gösteren boolean
|
||||
- **Ne Zaman**: Kullanıcı seviyesinin özel ayrıcalıklara sahip olup olmadığı kontrol edilirken
|
||||
|
||||
**`isNowAuth.level_check.decision`**
|
||||
- **Amaç**: Kullanıcı seviyesine dayalı kararı logla
|
||||
- **Loglanan Veriler**:
|
||||
- `action`: "allow"
|
||||
- `reason`: "user_level_in_exception_list"
|
||||
- `user_level`: Kullanıcının seviyesi
|
||||
- **Ne Zaman**: Kullanıcı seviyesi zaman limitinden muafiyet sağladığında
|
||||
- **Aksiyon**: true döner (güncellemeye izin verir)
|
||||
|
||||
**`isNowAuth.time_limit_check.initiating`**
|
||||
- **Amaç**: Zaman limiti kontrolü yapılmak üzereyken logla
|
||||
- **Loglanan Veriler**:
|
||||
- `user_level`: Kullanıcının seviyesi
|
||||
- `welding_date`: Kayıttaki kaynak tarihi
|
||||
- `created_at`: Kayıt oluşturma zaman damgası
|
||||
- **Ne Zaman**: checkWeldLogTimeLimit fonksiyonu çağrılmadan önce
|
||||
|
||||
**`isNowAuth.decision`**
|
||||
- **Amaç**: Final yetkilendirme kararlarını logla
|
||||
- **Loglanan Veriler**:
|
||||
- `action`: "allow" veya "deny"
|
||||
- `reason`: Kararın neden alındığının açıklaması
|
||||
- **Ne Zaman**: Fonksiyonun çeşitli çıkış noktalarında
|
||||
- **Olası Sebepler**:
|
||||
- "welding_date_empty": Kaynak tarihi yok, güncellemeye izin verildi
|
||||
- "not_weld_logs_table": Farklı tablo, özel kural yok
|
||||
|
||||
#### 2. isOnlyRealWelderFieldsUpdate Fonksiyonu
|
||||
|
||||
Sadece real_welder alanlarının güncellenip güncellenmediğini belirleyen yardımcı fonksiyon.
|
||||
|
||||
##### Log Anahtarları:
|
||||
|
||||
**`isOnlyRealWelderFieldsUpdate.analysis`**
|
||||
- **Amaç**: Güncellenen alanların detaylı analizini logla
|
||||
- **Loglanan Veriler**:
|
||||
- `updating_fields`: Güncellenen tüm alanların dizisi
|
||||
- `has_real_welder_update`: Herhangi bir real_welder alanının dahil olup olmadığını gösteren boolean
|
||||
- `other_fields`: Güncellenen real_welder olmayan alanların dizisi
|
||||
- `is_only_real_welder_update`: Boolean nihai sonuç
|
||||
- `real_welder_field_values`: real_welder_1 ve real_welder_2 değerlerini içeren nesne
|
||||
- **Ne Zaman**: Bu fonksiyon her çağrıldığında
|
||||
|
||||
#### 3. checkWeldLogTimeLimit Fonksiyonu
|
||||
|
||||
Güncellemenin izin verilen zaman limiti içinde olup olmadığını doğrular.
|
||||
|
||||
##### Log Anahtarları:
|
||||
|
||||
**`checkWeldLogTimeLimit.start`**
|
||||
- **Amaç**: Fonksiyon başlangıcını logla
|
||||
- **Loglanan Veriler**:
|
||||
- `query_id`: Kontrol edilen kayıt ID'si
|
||||
- `created_at`: Kayıt oluşturma zaman damgası
|
||||
- `created_at_is_null`: Boolean kontrol
|
||||
- **Ne Zaman**: Fonksiyon başlangıcında
|
||||
|
||||
**`checkWeldLogTimeLimit.calculation`**
|
||||
- **Amaç**: Zaman farkı hesaplamalarını logla
|
||||
- **Loglanan Veriler**:
|
||||
- `created_at`: Kayıt oluşturma zamanı
|
||||
- `current_time`: Mevcut zaman damgası
|
||||
- `allowed_hour_limit`: Ayarlardan alınan maksimum izin verilen saat
|
||||
- `actual_hour_difference`: Hesaplanan saat farkı
|
||||
- `within_limit`: İzin verilen zaman içinde olup olmadığını gösteren boolean
|
||||
- **Ne Zaman**: Zaman farkları hesaplandıktan sonra
|
||||
|
||||
**`checkWeldLogTimeLimit.decision`**
|
||||
- **Amaç**: Final zaman limiti kararını logla
|
||||
- **Loglanan Veriler**:
|
||||
- `action`: "allow" veya "deny"
|
||||
- `reason`: Kararın açıklaması
|
||||
- `hour_difference`: Geçen gerçek saatler (allow için)
|
||||
- `allowed_limit`: İzin verilen maksimum saat (allow için)
|
||||
- `exceeded_by`: Limitin üzerindeki saatler (sadece deny için)
|
||||
- **Ne Zaman**: Karar dönmeden önce
|
||||
- **Olası Sebepler**:
|
||||
- "within_time_limit": Güncellemeye izin verildi
|
||||
- "exceeded_time_limit": Güncelleme engellendi
|
||||
- "created_at_is_null": Oluşturma tarihi yok, engellendi
|
||||
|
||||
### Hata Ayıklama için Bu Logları Nasıl Kullanırız
|
||||
|
||||
#### 1. Tüm isNowAuth İşlemlerini İzle
|
||||
```bash
|
||||
tail -f storage/logs/laravel.log | grep "isNowAuth"
|
||||
```
|
||||
|
||||
#### 2. Belirli Yetkilendirme Hatalarını İzle
|
||||
```bash
|
||||
tail -f storage/logs/laravel.log | grep "isNowAuth.welder_check.blocked"
|
||||
```
|
||||
|
||||
#### 3. Zaman Limiti İhlallerini İzle
|
||||
```bash
|
||||
tail -f storage/logs/laravel.log | grep "checkWeldLogTimeLimit.decision" | grep "deny"
|
||||
```
|
||||
|
||||
#### 4. Real Welder Güncellemelerini İzle
|
||||
```bash
|
||||
tail -f storage/logs/laravel.log | grep "isNowAuth.real_welder_check"
|
||||
```
|
||||
|
||||
#### 5. Kullanıcı Seviye İstisnalarını İzle
|
||||
```bash
|
||||
tail -f storage/logs/laravel.log | grep "isNowAuth.level_check"
|
||||
```
|
||||
|
||||
### Yaygın Hata Ayıklama Senaryoları
|
||||
|
||||
#### Senaryo 1: Güncelleme Engellendi - Nedenini Bul
|
||||
|
||||
1. Loglarda kayıt ID'sini ara:
|
||||
```bash
|
||||
grep "query_id.*123" storage/logs/laravel.log | grep isNowAuth
|
||||
```
|
||||
|
||||
2. Karar loglarına bak:
|
||||
```bash
|
||||
grep "isNowAuth.decision\|isNowAuth.welder_check.blocked" storage/logs/laravel.log
|
||||
```
|
||||
|
||||
#### Senaryo 2: Zaman Limiti Sorunları
|
||||
|
||||
1. Zaman hesaplamalarını kontrol et:
|
||||
```bash
|
||||
grep "checkWeldLogTimeLimit.calculation" storage/logs/laravel.log | tail -1
|
||||
```
|
||||
|
||||
2. Kararı incele:
|
||||
```bash
|
||||
grep "checkWeldLogTimeLimit.decision" storage/logs/laravel.log | tail -1
|
||||
```
|
||||
|
||||
#### Senaryo 3: Real Welder Güncelleme Problemleri
|
||||
|
||||
1. Sadece real_welder güncellemesi olarak tanınıp tanınmadığını kontrol et:
|
||||
```bash
|
||||
grep "isOnlyRealWelderFieldsUpdate.analysis" storage/logs/laravel.log | tail -1
|
||||
```
|
||||
|
||||
2. Kaynakçı alan durumunu kontrol et:
|
||||
```bash
|
||||
grep "isNowAuth.real_welder_check.welder_status" storage/logs/laravel.log | tail -1
|
||||
```
|
||||
|
||||
### Log Seviyeleri
|
||||
|
||||
Tüm loglar `Log::debug()` kullanır, bu da şu anlama gelir:
|
||||
- `.env` dosyasında `APP_DEBUG=true` olduğunda log dosyasında görünürler
|
||||
- Varsayılan olarak production'da görünmezler (performans için)
|
||||
- Log girdilerinde "DEBUG" seviyesini kullanırlar
|
||||
|
||||
### En İyi Uygulamalar
|
||||
|
||||
1. **Logları her zaman sırayla kontrol et**: `isNowAuth.start`'tan final karara kadar akışı takip et
|
||||
2. **Grep'i context ile kullan**: Çevresindeki logları görmek için `-A 5 -B 5` ekle
|
||||
3. **Zaman damgasına göre filtrele**: Belirli sorunları debug ederken zaman aralığına göre filtrele
|
||||
4. **Önemli log bölümlerini kaydet**: İlgili logları dokümantasyon için dışa aktar
|
||||
5. **Production'ı dikkatli izle**: Production'da debug logları sadece geçici olarak etkinleştir
|
||||
|
||||
### Performans Değerlendirmeleri
|
||||
|
||||
- Debug loglar sadece `APP_DEBUG=true` olduğunda yazılır
|
||||
- Her yetkilendirme kontrolü 5-15 log girdisi oluşturur
|
||||
- Log dosyası rotasyonu düzgün yapılandırılmalıdır
|
||||
- Yüksek hacimli sistemler için log analiz araçları kullanmayı düşünün
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
# ITP User Guide
|
||||
|
||||
## What is the ITP Module?
|
||||
|
||||
The ITP (Inspection and Test Plan) module manages inspection and test plans for various project activities. This module helps ensure proper quality control procedures, define inspection requirements, and maintain quality standards throughout the project lifecycle.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access ITP:
|
||||
1. Login to the system
|
||||
2. Click on **RFI** in the main menu
|
||||
3. Select **ITP** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **ITP Creation**: Create and manage inspection and test plans
|
||||
- **Quality Control**: Define quality control procedures and requirements
|
||||
- **Documentation**: Maintain ITP documentation and records
|
||||
- **Approval Workflow**: Manage ITP approval and distribution
|
||||
|
||||
### Secondary Functions
|
||||
- **Template Management**: Use pre-built ITP templates
|
||||
- **Version Control**: Track ITP versions and updates
|
||||
- **Compliance Tracking**: Ensure compliance with quality standards
|
||||
- **Report Generation**: Generate ITP status reports
|
||||
|
||||
## How to Use
|
||||
|
||||
### Creating ITP Documents
|
||||
1. Click **"New ITP"** button
|
||||
2. Select project and activity type
|
||||
3. Choose appropriate ITP template
|
||||
4. Define inspection and test requirements
|
||||
5. Set quality control procedures
|
||||
6. Assign responsible personnel
|
||||
7. Submit for approval
|
||||
|
||||
### ITP Management
|
||||
1. Review ITP requirements and scope
|
||||
2. Update ITP as project progresses
|
||||
3. Track inspection and test completion
|
||||
4. Document deviations and corrective actions
|
||||
5. Generate ITP status reports
|
||||
|
||||
### ITP Categories
|
||||
- **Welding ITPs**: Welding inspection and test plans
|
||||
- **NDT ITPs**: Non-destructive testing plans
|
||||
- **Assembly ITPs**: Assembly and installation plans
|
||||
- **Commissioning ITPs**: Commissioning and testing plans
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Define clear inspection and test requirements
|
||||
- ✅ Include all necessary quality control procedures
|
||||
- ✅ Assign qualified personnel for inspections
|
||||
- ✅ Document all inspection and test results
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify ITP completeness and accuracy
|
||||
- ✅ Ensure compliance with quality standards
|
||||
- ✅ Regular review and update of ITPs
|
||||
- ✅ Monitor ITP implementation effectiveness
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **ITP not approved**: Check approval workflow and requirements
|
||||
2. **Missing requirements**: Review ITP scope and completeness
|
||||
3. **Implementation issues**: Contact quality control supervisor
|
||||
|
||||
### Getting Help
|
||||
- Contact the Quality Control department for support
|
||||
- Consult ITP templates and examples
|
||||
- Check ITP approval status and workflow
|
||||
@@ -1,115 +0,0 @@
|
||||
# Joint Release Log User Guide
|
||||
|
||||
## What is Joint Release Log?
|
||||
|
||||
The Joint Release Log is a **client-facing** module that displays only **welded joints** from production, including deleted-but-welded joints. It combines data from two sources:
|
||||
|
||||
- **Weld Logs** (active production records) — only joints where `type_of_welds` is a welded type (`is_welded = 1`)
|
||||
- **Deleted Joints** — joints that were removed (revision, error, scope change) but were actually welded
|
||||
|
||||
> **Critical Rule:** Joint Release = (welded joints) + (deleted but welded joints)
|
||||
|
||||
## How It Works
|
||||
|
||||
### Data Sources
|
||||
|
||||
| Source | Filter | Purpose |
|
||||
|--------|--------|---------|
|
||||
| `weld_logs` | `type_of_welds IN (welded types)` | Active welded production records |
|
||||
| `deleted_joints` | `type_of_welds IN (welded types)` + `welding_date IS NOT NULL` + not duplicated in weld_logs | Historical welded joints that were deleted |
|
||||
|
||||
### What is Excluded
|
||||
|
||||
- **Mechanical joints** (e.g., TH, FJ, BJ) — these are NOT welded, so they do not appear
|
||||
- **Deleted joints without welding date** — joints that were never actually welded
|
||||
- **Deleted joints that already exist in weld_logs** — to avoid duplicates
|
||||
|
||||
### Visual Indicators
|
||||
|
||||
- **DELETED badge** (red): Rows from `deleted_joints` are marked with a red "DELETED" badge and grayed out
|
||||
- **Deletion comment**: If a deletion reason was provided, it appears next to the badge
|
||||
|
||||
## Key Features
|
||||
|
||||
- **Read-only view**: All columns are read-only (no editing allowed)
|
||||
- **RFI Popups**: Click magnifier icons on RFI No fields to view related RFI details
|
||||
- **Block Groups**: Data is organized into sections (General Info, Spool Info, Joint Info, NDT Releases, etc.)
|
||||
- **PDF Attachments**: Links to Engineering, ISO, and As-Built drawings
|
||||
- **Mechanical Controls**: Mechanical joint fields are automatically disabled for welded joints
|
||||
|
||||
## Database Architecture
|
||||
|
||||
The module uses a MySQL VIEW called `joint_release_view` which combines both data sources with the `is_welded` filter applied at the database level. The DevExtreme datagrid queries this view directly for client-side operations (filtering, sorting, paging).
|
||||
|
||||
### Joint Type Classification
|
||||
|
||||
Joint types are defined in the `joint_types` table:
|
||||
|
||||
| Field | Description |
|
||||
|-------|-------------|
|
||||
| `is_welded` | `1` = welded joint (included in Joint Release) |
|
||||
| `is_mechanical` | `1` = mechanical joint (excluded from Joint Release) |
|
||||
| `has_ndt` | `1` = requires NDT testing |
|
||||
|
||||
---
|
||||
|
||||
# Joint Release Log Kullanıcı Kılavuzu (TR)
|
||||
|
||||
## Joint Release Log Nedir?
|
||||
|
||||
Joint Release Log, müşteriye sunulan **kaynaklı (welded) birleşimleri** gösteren bir modüldür. İki veri kaynağını birleştirir:
|
||||
|
||||
- **Weld Logs** (aktif üretim kayıtları) — sadece `type_of_welds` alanı kaynaklı tip olan (`is_welded = 1`) jointler
|
||||
- **Deleted Joints** (silinen jointler) — silinmiş ama gerçekten kaynak yapılmış olan jointler
|
||||
|
||||
> **KRİTİK KURAL:** Joint Release = (is_welded=1 olanlar) + (silinmiş ama welded olanlar)
|
||||
|
||||
## Nasıl Çalışır?
|
||||
|
||||
### Veri Kaynakları
|
||||
|
||||
| Kaynak | Filtre | Amaç |
|
||||
|--------|--------|------|
|
||||
| `weld_logs` | `type_of_welds IN (welded tipler)` | Aktif kaynaklı üretim kayıtları |
|
||||
| `deleted_joints` | `type_of_welds IN (welded tipler)` + `welding_date IS NOT NULL` + weld_logs'ta yok | Silinmiş ama kaynak yapılmış olan jointler |
|
||||
|
||||
### Neler Hariç Tutulur?
|
||||
|
||||
- **Mekanik jointler** (örn. TH, FJ, BJ) — bunlar kaynaklı değil, listede GÖRÜNMEZ
|
||||
- **Kaynak tarihi olmayan silinmiş jointler** — hiç kaynak yapılmamış olanlar
|
||||
- **Weld_logs'ta zaten mevcut olan silinmiş jointler** — mükerrer kayıt önlenmesi
|
||||
|
||||
### Görsel Göstergeler
|
||||
|
||||
- **DELETED rozeti** (kırmızı): `deleted_joints`'ten gelen satırlar kırmızı "DELETED" rozeti ile işaretlenir ve griyle gösterilir
|
||||
- **Silme yorumu**: Silme sebebi belirtilmişse rozet yanında görünür
|
||||
|
||||
## Temel Özellikler
|
||||
|
||||
- **Salt okunur görünüm**: Tüm sütunlar salt okunurdur (düzenleme yapılamaz)
|
||||
- **RFI Popupları**: RFI No alanlarındaki büyüteç simgelerine tıklayarak RFI detaylarını görüntüleyin
|
||||
- **Blok Grupları**: Veriler bölümler halinde organize edilir (Genel Bilgi, Spool Bilgisi, Joint Bilgisi, NDT Release'leri vb.)
|
||||
- **PDF Ekleri**: Engineering, ISO ve As-Built çizim bağlantıları
|
||||
- **Mekanik Kontroller**: Mekanik joint alanları otomatik olarak devre dışı bırakılır
|
||||
|
||||
## Veritabanı Mimarisi
|
||||
|
||||
Modül, `joint_release_view` adlı bir MySQL VIEW kullanır. Bu VIEW, her iki veri kaynağını `is_welded` filtresi ile birleştirir. DevExtreme datagrid, istemci tarafı işlemler (filtreleme, sıralama, sayfalama) için doğrudan bu VIEW'ı sorgular.
|
||||
|
||||
### Joint Tip Sınıflandırması
|
||||
|
||||
Joint tipleri `joint_types` tablosunda tanımlanır:
|
||||
|
||||
| Alan | Açıklama |
|
||||
|------|----------|
|
||||
| `is_welded` | `1` = kaynaklı joint (Joint Release'e dahil) |
|
||||
| `is_mechanical` | `1` = mekanik joint (Joint Release'den hariç) |
|
||||
| `has_ndt` | `1` = NDT testi gerektirir |
|
||||
|
||||
## Sorun Giderme
|
||||
|
||||
### Sık Karşılaşılan Sorunlar
|
||||
|
||||
1. **Kayıt sayısı beklenenden az**: Bu normal — artık sadece kaynaklı (`is_welded=1`) jointler gösteriliyor
|
||||
2. **Silinmiş joint görünmüyor**: Joint tipinin kaynaklı (`is_welded=1`) olduğundan ve `welding_date` alanının dolu olduğundan emin olun
|
||||
3. **Mekanik jointler görünmüyor**: Bu tasarım gereğidir — Joint Release sadece kaynaklı jointleri gösterir
|
||||
@@ -1,74 +0,0 @@
|
||||
# Languages User Guide
|
||||
|
||||
## What is the Languages Module?
|
||||
|
||||
The Languages module manages system language settings and localization features. This module allows users to configure the system interface language, manage multilingual content, and ensure proper localization for international projects.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Languages:
|
||||
1. Login to the system
|
||||
2. Click on **Settings** in the main menu
|
||||
3. Select **Languages** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Language Selection**: Choose system interface language
|
||||
- **Localization Management**: Manage multilingual content and settings
|
||||
- **Translation Support**: Support for multiple languages
|
||||
- **Regional Settings**: Configure regional formats and preferences
|
||||
|
||||
### Secondary Functions
|
||||
- **Language Packs**: Install and manage language packs
|
||||
- **Translation Tools**: Tools for content translation
|
||||
- **Format Settings**: Configure date, time, and number formats
|
||||
- **User Preferences**: Set individual user language preferences
|
||||
|
||||
## How to Use
|
||||
|
||||
### Changing System Language
|
||||
1. Access Languages module
|
||||
2. Select desired language from available options
|
||||
3. Configure regional settings if needed
|
||||
4. Save language preferences
|
||||
5. Restart system or refresh interface
|
||||
|
||||
### Language Configuration
|
||||
1. Choose primary interface language
|
||||
2. Set secondary language options
|
||||
3. Configure date and time formats
|
||||
4. Set number and currency formats
|
||||
5. Save configuration settings
|
||||
|
||||
### Available Languages
|
||||
- **English**: Primary system language
|
||||
- **Turkish**: Local language support
|
||||
- **Arabic**: Right-to-left language support
|
||||
- **Other Languages**: Additional language options
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Choose appropriate language for project requirements
|
||||
- ✅ Configure regional settings for local standards
|
||||
- ✅ Ensure proper language pack installation
|
||||
- ✅ Test interface in selected language
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify language translation accuracy
|
||||
- ✅ Check interface layout in different languages
|
||||
- ✅ Test regional format settings
|
||||
- ✅ Ensure proper character encoding
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Language not changing**: Check language pack installation
|
||||
2. **Translation errors**: Verify translation file integrity
|
||||
3. **Format issues**: Check regional settings configuration
|
||||
|
||||
### Getting Help
|
||||
- Contact the IT department for technical support
|
||||
- Consult language configuration documentation
|
||||
- Check language pack installation status
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,318 +0,0 @@
|
||||
# Line List User Guide
|
||||
|
||||
## What is Line List?
|
||||
|
||||
Line List is your master database of all piping lines in the project. Every pipe, from small drain lines to major process lines, has specific requirements for materials, testing, and construction. This module stores all that critical information.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Line List:
|
||||
1. Login to the system
|
||||
2. Click on **Manufacturing** in the main menu
|
||||
3. Select **Line list** from the submenu
|
||||
|
||||
## Understanding Line Data
|
||||
|
||||
### What's in a Line Record?
|
||||
Each line contains:
|
||||
- **Line Number**: Unique identifier (like 1001-P-6"-CS-150)
|
||||
- **Service**: What flows through the pipe (steam, water, oil, etc.)
|
||||
- **Design Conditions**: Pressure and temperature requirements
|
||||
- **Material Specification**: What the pipe is made of
|
||||
- **Testing Requirements**: NDT percentages and pressure test info
|
||||
- **Special Requirements**: Insulation, painting, tracing
|
||||
|
||||
### Line Number Format
|
||||
Typical format: **XXXX-Y-Z"-MM-RRR**
|
||||
- **XXXX**: Line number (1001, 2505, etc.)
|
||||
- **Y**: Service code (P=Process, U=Utility, etc.)
|
||||
- **Z"**: Nominal pipe size (6", 12", etc.)
|
||||
- **MM**: Material code (CS=Carbon Steel, SS=Stainless, etc.)
|
||||
- **RRR**: Pressure rating (150, 300, 600, etc.)
|
||||
|
||||
## Creating New Line Records
|
||||
|
||||
### Basic Line Information
|
||||
1. Click **"Add New Line"**
|
||||
2. Enter essential data:
|
||||
- **Line Number**: Follow project numbering system
|
||||
- **Description**: Brief service description
|
||||
- **From/To**: Start and end points
|
||||
- **Unit/Area**: Which part of the plant
|
||||
|
||||
### Process Information
|
||||
**Service Details:**
|
||||
- **Fluid Type**: Liquid, gas, steam, etc.
|
||||
- **Fluid Name**: Water, crude oil, natural gas, etc.
|
||||
- **Normal Flow**: Typical operating conditions
|
||||
- **Maximum Flow**: Peak capacity requirements
|
||||
|
||||
**Operating Conditions:**
|
||||
- **Operating Pressure**: Normal working pressure
|
||||
- **Operating Temperature**: Normal working temperature
|
||||
- **Design Pressure**: Maximum allowable pressure
|
||||
- **Design Temperature**: Maximum allowable temperature
|
||||
|
||||
### Material Specifications
|
||||
|
||||
**Pipe Material:**
|
||||
- **Material Grade**: A106, A53, A312, etc.
|
||||
- **Schedule**: Wall thickness (40, 80, 160, etc.)
|
||||
- **Corrosion Allowance**: Extra thickness for corrosion
|
||||
- **Special Requirements**: NACE, low temp, etc.
|
||||
|
||||
**Fittings and Valves:**
|
||||
- **Fitting Material**: Usually matches pipe
|
||||
- **End Connections**: Welded, flanged, threaded
|
||||
- **Valve Types**: Gate, globe, ball, check, etc.
|
||||
- **Special Trim**: Hard facing, special seats
|
||||
|
||||
## Quality Requirements
|
||||
|
||||
### NDT (Non-Destructive Testing)
|
||||
**Testing Percentages:**
|
||||
- **RT (Radiographic)**: Usually 10%, 25%, or 100%
|
||||
- **UT (Ultrasonic)**: For thicker walls
|
||||
- **PT (Penetrant)**: Surface defect detection
|
||||
- **MT (Magnetic)**: For ferromagnetic materials
|
||||
|
||||
**Testing Notes:**
|
||||
- **Critical joints**: 100% RT required
|
||||
- **Random selection**: How to choose joints
|
||||
- **Repair requirements**: Re-test after repairs
|
||||
- **Documentation**: Report requirements
|
||||
|
||||
### Pressure Testing
|
||||
**Hydrostatic Test:**
|
||||
- **Test Pressure**: Usually 1.5 x design pressure
|
||||
- **Test Medium**: Water (usually) or other fluid
|
||||
- **Test Duration**: Hold time at pressure
|
||||
- **Acceptance Criteria**: No leaks, no permanent deformation
|
||||
|
||||
**Pneumatic Test:**
|
||||
- **Test Pressure**: Lower than hydrostatic
|
||||
- **Test Medium**: Air or inert gas
|
||||
- **Safety Requirements**: Extra precautions needed
|
||||
- **When Used**: When water testing not practical
|
||||
|
||||
## Special Requirements
|
||||
|
||||
### Insulation and Tracing
|
||||
**Heat Tracing:**
|
||||
- **Type**: Electric or steam tracing
|
||||
- **Temperature**: Maintain temperature
|
||||
- **Coverage**: Full line or partial
|
||||
- **Controls**: Temperature monitoring
|
||||
|
||||
**Insulation:**
|
||||
- **Type**: Mineral wool, foam, etc.
|
||||
- **Thickness**: Based on service temperature
|
||||
- **Weather Protection**: Aluminum cladding
|
||||
- **Fire Rating**: Special fire protection
|
||||
|
||||
### Painting and Coatings
|
||||
**External Coating:**
|
||||
- **Primer**: Base coat specification
|
||||
- **Finish Coat**: Top coat color and type
|
||||
- **Special Coatings**: Chemical resistant, high temp
|
||||
- **Touch-up**: Field painting requirements
|
||||
|
||||
**Internal Coating:**
|
||||
- **When Required**: Corrosive services
|
||||
- **Type**: Epoxy, phenolic, etc.
|
||||
- **Application**: Before or after installation
|
||||
- **Quality Control**: Holiday testing
|
||||
|
||||
## Using Line Data in Other Modules
|
||||
|
||||
### Weldmap Integration
|
||||
When you select a line number in Weldmap:
|
||||
- **Design conditions** auto-populate
|
||||
- **Material info** fills in automatically
|
||||
- **NDT requirements** are set correctly
|
||||
- **Testing info** transfers over
|
||||
|
||||
### Test Package Planning
|
||||
Line data helps determine:
|
||||
- **Which lines** group together for testing
|
||||
- **Test pressure** for each package
|
||||
- **NDT requirements** for the package
|
||||
- **Special procedures** needed
|
||||
|
||||
### Material Planning
|
||||
Line list drives:
|
||||
- **Pipe quantities** needed
|
||||
- **Fitting requirements** by size and type
|
||||
- **Valve specifications** and quantities
|
||||
- **Special material** requirements
|
||||
|
||||
## Searching and Filtering
|
||||
|
||||
### Finding Specific Lines
|
||||
**By Service:**
|
||||
1. Use service filter dropdown
|
||||
2. Select type (Process, Utility, etc.)
|
||||
3. View all lines of that type
|
||||
|
||||
**By Area:**
|
||||
1. Filter by unit or area
|
||||
2. See all lines in specific location
|
||||
3. Plan work by geographical area
|
||||
|
||||
**By Size:**
|
||||
1. Filter by pipe diameter
|
||||
2. Group similar size work
|
||||
3. Plan resource requirements
|
||||
|
||||
### Advanced Searches
|
||||
**By Material:**
|
||||
- Find all stainless steel lines
|
||||
- Group by material grade
|
||||
- Plan special welding requirements
|
||||
|
||||
**By Pressure:**
|
||||
- High pressure lines need special attention
|
||||
- Group by pressure class
|
||||
- Plan testing sequences
|
||||
|
||||
## Updating Line Information
|
||||
|
||||
### When to Update
|
||||
**During Design:**
|
||||
- Design conditions change
|
||||
- Material specifications revised
|
||||
- New safety requirements added
|
||||
- Client specifications updated
|
||||
|
||||
**During Construction:**
|
||||
- Field changes required
|
||||
- Material substitutions approved
|
||||
- Route modifications needed
|
||||
- As-built information recorded
|
||||
|
||||
### Change Control
|
||||
**Documentation Required:**
|
||||
- **Change request**: Formal modification request
|
||||
- **Engineering approval**: Technical review
|
||||
- **Client approval**: If contractually required
|
||||
- **Updated drawings**: Reflect changes
|
||||
|
||||
**Impact Assessment:**
|
||||
- **Cost impact**: Additional materials/labor
|
||||
- **Schedule impact**: Delays or acceleration
|
||||
- **Quality impact**: Different testing requirements
|
||||
- **Safety impact**: New hazard assessment
|
||||
|
||||
## Common Tasks
|
||||
|
||||
### Daily Line Review
|
||||
1. **Check new lines** added to system
|
||||
2. **Review updates** to existing lines
|
||||
3. **Verify data** accuracy for your area
|
||||
4. **Plan work** based on line priorities
|
||||
|
||||
### Weekly Planning
|
||||
1. **Group lines** by location for efficient work
|
||||
2. **Check material** availability
|
||||
3. **Plan NDT** scheduling by line requirements
|
||||
4. **Coordinate** with other disciplines
|
||||
|
||||
### Project Reporting
|
||||
1. **Export line data** to Excel
|
||||
2. **Generate progress** reports by area
|
||||
3. **Track completion** by line
|
||||
4. **Analyze** productivity by line type
|
||||
|
||||
## Quality Assurance
|
||||
|
||||
### Data Verification
|
||||
**Check These Items:**
|
||||
- ✅ Line numbers follow project standards
|
||||
- ✅ Design conditions are realistic
|
||||
- ✅ Material specs match project requirements
|
||||
- ✅ NDT percentages per applicable codes
|
||||
- ✅ Test pressures calculated correctly
|
||||
|
||||
### Consistency Checks
|
||||
- **Same service** lines have similar requirements
|
||||
- **Material grades** appropriate for conditions
|
||||
- **NDT requirements** match criticality
|
||||
- **Test pressures** follow standard calculations
|
||||
|
||||
## Integration Points
|
||||
|
||||
### With Engineering
|
||||
- **P&ID updates** flow to line list
|
||||
- **Specification changes** update automatically
|
||||
- **Material selections** drive requirements
|
||||
- **Safety studies** influence testing
|
||||
|
||||
### With Procurement
|
||||
- **Material quantities** from line data
|
||||
- **Special requirements** flagged early
|
||||
- **Delivery schedules** based on construction plan
|
||||
- **Quality requirements** specified clearly
|
||||
|
||||
### With Construction
|
||||
- **Work packages** organized by lines
|
||||
- **Resource planning** based on line types
|
||||
- **Progress tracking** by line completion
|
||||
- **Quality requirements** clearly defined
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Can't find specific line:**
|
||||
- Check spelling of line number
|
||||
- Try partial searches
|
||||
- Verify correct project/area selected
|
||||
- Use filters to narrow search
|
||||
|
||||
**Data seems incorrect:**
|
||||
- Verify against latest P&IDs
|
||||
- Check for recent engineering changes
|
||||
- Compare with similar lines
|
||||
- Contact engineering for clarification
|
||||
|
||||
**Updates not saving:**
|
||||
- Check user permissions
|
||||
- Verify all required fields completed
|
||||
- Try refreshing page
|
||||
- Contact IT support if persistent
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Data Management
|
||||
- ✅ Keep line data current with design
|
||||
- ✅ Use consistent naming conventions
|
||||
- ✅ Document all changes properly
|
||||
- ✅ Verify accuracy regularly
|
||||
|
||||
### Cross-References
|
||||
- ✅ Link to related drawings
|
||||
- ✅ Reference applicable specifications
|
||||
- ✅ Connect to material requisitions
|
||||
- ✅ Tie to construction work packages
|
||||
|
||||
### Quality Control
|
||||
- ✅ Review data before construction starts
|
||||
- ✅ Update with as-built information
|
||||
- ✅ Maintain traceability to design
|
||||
- ✅ Archive completed line data
|
||||
|
||||
## Getting Help
|
||||
|
||||
**For Line Data Questions:**
|
||||
- Check project specifications
|
||||
- Review P&ID drawings
|
||||
- Consult process engineer
|
||||
- Ask piping designer
|
||||
|
||||
**For System Issues:**
|
||||
- Try refresh/restart first
|
||||
- Note specific error messages
|
||||
- Contact IT with line numbers
|
||||
- Provide screenshots if helpful
|
||||
|
||||
Remember: Line List is the foundation for all other piping activities. Accurate data here makes everything else run smoothly!
|
||||
@@ -1,76 +0,0 @@
|
||||
# Employees (Main-Employees) User Guide
|
||||
|
||||
## What is the Employees (Main-Employees) Module?
|
||||
|
||||
The Employees (Main-Employees) module manages comprehensive employee information and records in the main system. This module helps track employee data, manage employee records, and ensure proper employee information management.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Employees (Main-Employees):
|
||||
1. Login to the system
|
||||
2. Click on **Main-Employees** in the main menu
|
||||
3. Select **Employees** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Employee Management**: Manage employee information and records
|
||||
- **Data Tracking**: Track employee data and information
|
||||
- **Record Management**: Manage employee records
|
||||
- **Documentation**: Maintain employee documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate employee reports
|
||||
- **Search and Filter**: Search and filter employee data
|
||||
- **Export Options**: Export employee data in various formats
|
||||
- **Data Validation**: Validate employee data integrity
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing Employees
|
||||
1. Click **"Manage Employees"** button
|
||||
2. Select employee for management
|
||||
3. Review employee information
|
||||
4. Update employee data
|
||||
5. Track employee records
|
||||
6. Generate employee reports
|
||||
7. Export employee data
|
||||
|
||||
### Employee Management
|
||||
1. Review employee information
|
||||
2. Update employee data
|
||||
3. Manage employee records
|
||||
4. Track employee status
|
||||
5. Generate employee reports
|
||||
|
||||
### Employee Categories
|
||||
- **Active Employees**: Currently active employees
|
||||
- **Inactive Employees**: Inactive employee records
|
||||
- **Contract Employees**: Contract-based employees
|
||||
- **Temporary Employees**: Temporary employees
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Keep employee data current and accurate
|
||||
- ✅ Update employee information promptly
|
||||
- ✅ Maintain proper employee records
|
||||
- ✅ Regular backup of employee data
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify employee data accuracy
|
||||
- ✅ Ensure proper data validation
|
||||
- ✅ Monitor employee management effectiveness
|
||||
- ✅ Regular review of employee processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Employee not saving**: Check all required fields are completed
|
||||
2. **Data errors**: Verify employee data accuracy
|
||||
3. **Export problems**: Check export format and data size
|
||||
|
||||
### Getting Help
|
||||
- Contact the Main-Employees department for technical support
|
||||
- Consult employee management procedures and guidelines
|
||||
- Check employee data and system status
|
||||
@@ -1,76 +0,0 @@
|
||||
# Manage NDT User Guide
|
||||
|
||||
## What is the Manage NDT Module?
|
||||
|
||||
The Manage NDT module provides comprehensive management tools for Non-Destructive Testing (NDT) operations. This module helps coordinate NDT activities, manage testing schedules, track results, and ensure quality control across all NDT processes.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Manage NDT:
|
||||
1. Login to the system
|
||||
2. Click on **NDT** in the main menu
|
||||
3. Select **Manage NDT** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **NDT Planning**: Plan and schedule NDT activities
|
||||
- **Resource Management**: Manage NDT personnel and equipment
|
||||
- **Quality Control**: Monitor NDT quality and compliance
|
||||
- **Result Tracking**: Track NDT results and findings
|
||||
|
||||
### Secondary Functions
|
||||
- **Equipment Management**: Track NDT equipment calibration and maintenance
|
||||
- **Personnel Management**: Manage NDT operator qualifications
|
||||
- **Report Generation**: Generate NDT reports and analytics
|
||||
- **Compliance Monitoring**: Ensure NDT compliance with standards
|
||||
|
||||
## How to Use
|
||||
|
||||
### Planning NDT Activities
|
||||
1. Click **"New NDT Plan"** button
|
||||
2. Select NDT method and scope
|
||||
3. Define testing requirements and specifications
|
||||
4. Assign NDT personnel and equipment
|
||||
5. Set testing schedule and milestones
|
||||
6. Submit plan for approval
|
||||
7. Track plan execution
|
||||
|
||||
### Managing NDT Resources
|
||||
1. Review NDT personnel qualifications
|
||||
2. Check equipment availability and calibration
|
||||
3. Assign resources to NDT activities
|
||||
4. Monitor resource utilization
|
||||
5. Update resource status
|
||||
|
||||
### NDT Methods Management
|
||||
- **Radiographic Testing (RT)**: X-ray and gamma ray testing
|
||||
- **Ultrasonic Testing (UT)**: Ultrasonic flaw detection
|
||||
- **Magnetic Particle Testing (MT)**: Magnetic particle inspection
|
||||
- **Penetrant Testing (PT)**: Liquid penetrant testing
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Plan NDT activities in advance
|
||||
- ✅ Ensure qualified personnel and calibrated equipment
|
||||
- ✅ Follow established NDT procedures
|
||||
- ✅ Document all NDT activities and results
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify NDT operator qualifications
|
||||
- ✅ Check equipment calibration status
|
||||
- ✅ Monitor NDT quality and accuracy
|
||||
- ✅ Regular review of NDT procedures
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Equipment unavailable**: Check equipment status and scheduling
|
||||
2. **Personnel shortage**: Review personnel qualifications and availability
|
||||
3. **Quality issues**: Contact NDT supervisor for resolution
|
||||
|
||||
### Getting Help
|
||||
- Contact the NDT department for technical support
|
||||
- Consult NDT procedures and standards
|
||||
- Check equipment and personnel status
|
||||
@@ -1,76 +0,0 @@
|
||||
# Manage Welding User Guide
|
||||
|
||||
## What is the Manage Welding Module?
|
||||
|
||||
The Manage Welding module provides comprehensive management tools for welding operations. This module helps coordinate welding activities, manage welder qualifications, track welding quality, and ensure compliance with welding standards and procedures.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Manage Welding:
|
||||
1. Login to the system
|
||||
2. Click on **Manufacturing** in the main menu
|
||||
3. Select **Manage Welding** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Welding Planning**: Plan and schedule welding activities
|
||||
- **Welder Management**: Manage welder qualifications and assignments
|
||||
- **Quality Control**: Monitor welding quality and compliance
|
||||
- **Progress Tracking**: Track welding progress and completion
|
||||
|
||||
### Secondary Functions
|
||||
- **Equipment Management**: Track welding equipment and maintenance
|
||||
- **Material Management**: Manage welding materials and consumables
|
||||
- **Report Generation**: Generate welding reports and analytics
|
||||
- **Compliance Monitoring**: Ensure welding compliance with standards
|
||||
|
||||
## How to Use
|
||||
|
||||
### Planning Welding Activities
|
||||
1. Click **"New Welding Plan"** button
|
||||
2. Select welding process and scope
|
||||
3. Define welding requirements and specifications
|
||||
4. Assign qualified welders and equipment
|
||||
5. Set welding schedule and milestones
|
||||
6. Submit plan for approval
|
||||
7. Track plan execution
|
||||
|
||||
### Managing Welding Resources
|
||||
1. Review welder qualifications and certifications
|
||||
2. Check equipment availability and condition
|
||||
3. Assign resources to welding activities
|
||||
4. Monitor resource utilization
|
||||
5. Update resource status
|
||||
|
||||
### Welding Process Management
|
||||
- **SMAW**: Shielded Metal Arc Welding
|
||||
- **GMAW**: Gas Metal Arc Welding
|
||||
- **GTAW**: Gas Tungsten Arc Welding
|
||||
- **FCAW**: Flux-Cored Arc Welding
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Plan welding activities in advance
|
||||
- ✅ Ensure qualified welders and proper equipment
|
||||
- ✅ Follow established welding procedures
|
||||
- ✅ Document all welding activities and results
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify welder qualifications and certifications
|
||||
- ✅ Check equipment condition and calibration
|
||||
- ✅ Monitor welding quality and compliance
|
||||
- ✅ Regular review of welding procedures
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Equipment unavailable**: Check equipment status and maintenance
|
||||
2. **Welder shortage**: Review welder qualifications and availability
|
||||
3. **Quality issues**: Contact welding supervisor for resolution
|
||||
|
||||
### Getting Help
|
||||
- Contact the Manufacturing department for technical support
|
||||
- Consult welding procedures and standards
|
||||
- Check equipment and welder status
|
||||
@@ -1,75 +0,0 @@
|
||||
# Manufacturing User Guide
|
||||
|
||||
## What is the Manufacturing Module?
|
||||
|
||||
The Manufacturing module serves as the central hub for all manufacturing operations and activities. This module provides access to various manufacturing tools, manages production processes, and ensures quality control across manufacturing operations.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Manufacturing:
|
||||
1. Login to the system
|
||||
2. Click on **Manufacturing** in the main menu
|
||||
3. Access various manufacturing tools and features
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Production Planning**: Plan and schedule manufacturing activities
|
||||
- **Process Management**: Manage manufacturing processes and workflows
|
||||
- **Quality Control**: Monitor manufacturing quality and standards
|
||||
- **Resource Management**: Manage manufacturing resources and equipment
|
||||
|
||||
### Secondary Functions
|
||||
- **Inventory Management**: Track manufacturing materials and inventory
|
||||
- **Equipment Management**: Manage manufacturing equipment and maintenance
|
||||
- **Performance Monitoring**: Monitor manufacturing performance and efficiency
|
||||
- **Reporting**: Generate manufacturing reports and analytics
|
||||
|
||||
## How to Use
|
||||
|
||||
### Manufacturing Workflow
|
||||
1. Review production requirements and specifications
|
||||
2. Plan manufacturing activities and schedules
|
||||
3. Assign resources and equipment
|
||||
4. Execute manufacturing processes
|
||||
5. Monitor quality and progress
|
||||
6. Document results and completion
|
||||
|
||||
### Manufacturing Categories
|
||||
- **Fabrication**: Metal fabrication and assembly
|
||||
- **Welding**: Welding operations and quality control
|
||||
- **Assembly**: Component assembly and integration
|
||||
- **Testing**: Manufacturing testing and validation
|
||||
|
||||
### Resource Management
|
||||
1. Review equipment availability and condition
|
||||
2. Assign qualified personnel to tasks
|
||||
3. Monitor material inventory and requirements
|
||||
4. Track resource utilization and efficiency
|
||||
5. Update resource status and availability
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Follow established manufacturing procedures
|
||||
- ✅ Ensure proper resource allocation and planning
|
||||
- ✅ Monitor quality control throughout processes
|
||||
- ✅ Document all manufacturing activities and results
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify manufacturing specifications and requirements
|
||||
- ✅ Check equipment condition and calibration
|
||||
- ✅ Monitor process quality and compliance
|
||||
- ✅ Regular review of manufacturing procedures
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Resource shortage**: Check resource availability and scheduling
|
||||
2. **Quality issues**: Review manufacturing procedures and quality control
|
||||
3. **Equipment problems**: Contact equipment maintenance
|
||||
|
||||
### Getting Help
|
||||
- Contact the Manufacturing department for technical support
|
||||
- Consult manufacturing procedures and standards
|
||||
- Check resource availability and equipment status
|
||||
@@ -1,803 +0,0 @@
|
||||
# Material Group Map System
|
||||
|
||||
## Overview
|
||||
|
||||
The Material Group Map system is a critical component that manages qualified material combinations for welder assignments. It defines which material combinations are interchangeable or equivalent based on welding qualification standards.
|
||||
|
||||
## Purpose
|
||||
|
||||
When assigning welders to joints, the system needs to verify that a welder qualified for specific material groups (e.g., `1(M01)+9(M11)`) can also work with equivalent or qualified material combinations (e.g., `1(M01)+8(M11)`, `1(M01)+11(M11)`).
|
||||
|
||||
## Database Structure
|
||||
|
||||
### Table: `material_group_maps`
|
||||
|
||||
- **material_name**: The base material or material combination (e.g., `1(M01)+9(M11)` or `9(M11)`)
|
||||
- **qualified_materials**: Comma-separated list of qualified/equivalent materials (e.g., `1(M01)+8(M11),1(M01)+9(M11),1(M01)+11(M11)`)
|
||||
|
||||
### Example Data
|
||||
|
||||
| material_name | qualified_materials |
|
||||
|---------------|---------------------|
|
||||
| 9(M11) | 8(M11),11(M11),9(M11),11(M51) |
|
||||
| 8(M11) | 8(M11),11(M11),9(M11) |
|
||||
| 11(M11) | 8(M11),11(M11),9(M11),11(M51) |
|
||||
| 1(M01) | 1(M01) |
|
||||
| 1(M01)+9(M11) | 1(M01)+8(M11),1(M01)+9(M11),1(M01)+11(M11) |
|
||||
|
||||
## Implementation Logic
|
||||
|
||||
### Correct Approach (Current Implementation)
|
||||
|
||||
The system uses **exact combination matching** to prevent over-qualification:
|
||||
|
||||
```php
|
||||
// Step 1: Check if materials are the same
|
||||
$isSameMaterial = ($ru1 === $ru2);
|
||||
|
||||
if ($isSameMaterial) {
|
||||
// Same material on both sides - use single material
|
||||
$materialCombination = $ru1; // e.g., "9(M11)"
|
||||
} else {
|
||||
// Different materials - use combination
|
||||
$materialCombination = $ru1 . "+" . $ru2; // e.g., "1(M01)+9(M11)"
|
||||
}
|
||||
|
||||
// Step 2: Search for exact match in material_group_maps
|
||||
$exactMatch = MaterialGroupMap::where("material_name", $materialCombination)->first();
|
||||
|
||||
// Step 3: If exact match found, parse its qualified materials
|
||||
if ($exactMatch && $exactMatch->qualified_materials) {
|
||||
$qualifiedMaterialsList = explode(",", $exactMatch->qualified_materials);
|
||||
foreach ($qualifiedMaterialsList as $combo) {
|
||||
$combo = trim($combo);
|
||||
$parts = explode("+", $combo);
|
||||
|
||||
if (count($parts) == 2) {
|
||||
// Different materials combination
|
||||
$qualifiedCombinations[] = [
|
||||
'mat1' => trim($parts[0]),
|
||||
'mat2' => trim($parts[1])
|
||||
];
|
||||
} elseif (count($parts) == 1) {
|
||||
// Single material (same on both sides)
|
||||
$qualifiedCombinations[] = [
|
||||
'mat1' => trim($parts[0]),
|
||||
'mat2' => trim($parts[0])
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Step 4: Always include original combination
|
||||
if ($isSameMaterial) {
|
||||
// Same material - add only once (no reverse needed)
|
||||
$qualifiedCombinations[] = ['mat1' => $ru1, 'mat2' => $ru2];
|
||||
} else {
|
||||
// Different materials - add both original and reverse
|
||||
$qualifiedCombinations[] = ['mat1' => $ru1, 'mat2' => $ru2];
|
||||
$qualifiedCombinations[] = ['mat1' => $ru2, 'mat2' => $ru1];
|
||||
}
|
||||
```
|
||||
|
||||
### Key Benefits
|
||||
|
||||
1. **Specific Combinations Only**: Only checks qualified materials for the exact input combination
|
||||
2. **Handles Same Materials Correctly**: Distinguishes between same materials (single entry) and different materials (combination)
|
||||
3. **Predictable Results**: Returns consistent number of records matching the database
|
||||
4. **No Exponential Growth**: Avoids N² combination explosion
|
||||
5. **Optimized Queries**: Reduces redundant combinations when materials are identical
|
||||
|
||||
### Example Scenario
|
||||
|
||||
**Input:**
|
||||
- `ru_1 = "1(M01)"`
|
||||
- `ru_2 = "9(M11)"`
|
||||
|
||||
**Process:**
|
||||
1. Search for exact match: `"1(M01)+9(M11)"` in `material_group_maps.material_name`
|
||||
2. Found match with qualified_materials: `"1(M01)+8(M11),1(M01)+9(M11),1(M01)+11(M11)"`
|
||||
3. Create qualified combinations array:
|
||||
- `1(M01)` + `8(M11)`
|
||||
- `1(M01)` + `9(M11)`
|
||||
- `1(M01)` + `11(M11)`
|
||||
- `9(M11)` + `1(M01)` (reverse of original)
|
||||
- `1(M01)` + `9(M11)` (original)
|
||||
|
||||
**Result:** System searches for welders qualified for these **5 specific combinations** only.
|
||||
|
||||
## Common Pitfall: Incorrect Implementation
|
||||
|
||||
### ❌ Wrong Approach (Nested Foreach - N² Problem)
|
||||
|
||||
```php
|
||||
// INCORRECT - DO NOT USE
|
||||
$qualifiedMaterialsRU1 = materialGroupMap($ru1, $ru2); // Returns array of materials
|
||||
$qualifiedMaterialsRU2 = materialGroupMap($ru2, $ru1); // Returns array of materials
|
||||
$allQualifiedMaterials = array_merge($qualifiedMaterialsRU1, $qualifiedMaterialsRU2);
|
||||
|
||||
// This creates N² combinations!
|
||||
foreach ($allQualifiedMaterials as $mat1) {
|
||||
foreach ($allQualifiedMaterials as $mat2) {
|
||||
// Check material_group_1 = $mat1 AND material_group_2 = $mat2
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Why This Is Wrong
|
||||
|
||||
If `allQualifiedMaterials` contains 5 elements: `["1(M01)", "8(M11)", "9(M11)", "11(M11)", "11(M51)"]`
|
||||
|
||||
The nested foreach creates **25 combinations** (5×5):
|
||||
- `1(M01)` + `1(M01)`
|
||||
- `1(M01)` + `8(M11)`
|
||||
- `1(M01)` + `9(M11)`
|
||||
- `1(M01)` + `11(M11)`
|
||||
- `1(M01)` + `11(M51)`
|
||||
- `8(M11)` + `1(M01)`
|
||||
- ... (20 more combinations)
|
||||
|
||||
**Problem:** Most of these combinations are invalid or unintended, leading to:
|
||||
- Too many welder records returned
|
||||
- Welders qualified for unrelated material combinations
|
||||
- Inconsistent results compared to the database
|
||||
|
||||
## Usage in Different Modules
|
||||
|
||||
### 1. Welder Assignment (welder_1.php)
|
||||
|
||||
File: `app/Http/Controllers/AutoCompleteType/welder-assignment/welder_1.php`
|
||||
|
||||
**Purpose:** Auto-complete welder selection based on joint requirements
|
||||
|
||||
**Implementation:**
|
||||
- Uses exact combination matching
|
||||
- Searches `welder_tests` table with material group criteria
|
||||
- Returns list of qualified welders for the specific combination
|
||||
|
||||
### 2. Welder Qualification Table (welder-qualification-table.blade.php)
|
||||
|
||||
File: `resources/views/admin-ajax/welder-qualification-table.blade.php`
|
||||
|
||||
**Purpose:** Display all welder qualifications with their qualified materials
|
||||
|
||||
**Implementation:**
|
||||
- Shows each welder's qualification with material groups
|
||||
- Displays qualified materials for each combination
|
||||
- Used for verification and reference
|
||||
|
||||
## Query Pattern
|
||||
|
||||
Both modules use consistent query pattern:
|
||||
|
||||
```php
|
||||
->where(function ($query) use ($qualifiedCombinations) {
|
||||
foreach ($qualifiedCombinations as $combo) {
|
||||
$query->orWhere(function($q) use ($combo) {
|
||||
$q->where("material_group_1", "like", "%{$combo['mat1']}%")
|
||||
->where("material_group_2", "like", "%{$combo['mat2']}%");
|
||||
});
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## Same Material Handling
|
||||
|
||||
### 🇬🇧 English
|
||||
|
||||
When both material groups are identical (e.g., `ru_1 = "9(M11)"` and `ru_2 = "9(M11)"`), the system must handle this case differently from material combinations.
|
||||
|
||||
#### The Problem
|
||||
|
||||
**Incorrect Approach:**
|
||||
```php
|
||||
// Always concatenating with "+"
|
||||
$materialCombination = $ru1 . "+" . $ru2;
|
||||
// Results in: "9(M11)+9(M11)" ❌
|
||||
```
|
||||
|
||||
This creates issues because:
|
||||
- The database stores same materials as single entries: `"9(M11)"`
|
||||
- Searching for `"9(M11)+9(M11)"` won't find the record
|
||||
- No qualified materials are returned
|
||||
- Welder assignment fails
|
||||
|
||||
#### The Solution
|
||||
|
||||
**Correct Approach:**
|
||||
```php
|
||||
// Check if materials are identical
|
||||
$isSameMaterial = ($ru1 === $ru2);
|
||||
|
||||
if ($isSameMaterial) {
|
||||
// Same material on both sides - use single material
|
||||
$materialCombination = $ru1; // "9(M11)" ✅
|
||||
} else {
|
||||
// Different materials - use combination
|
||||
$materialCombination = $ru1 . "+" . $ru2; // "1(M01)+9(M11)" ✅
|
||||
}
|
||||
```
|
||||
|
||||
#### Implementation Details
|
||||
|
||||
**1. Material Combination Check (Lines 33-41 in welder_1.php):**
|
||||
```php
|
||||
$isSameMaterial = ($rowData['ru_1'] === $rowData['ru_2']);
|
||||
|
||||
if ($isSameMaterial) {
|
||||
// Same material on both sides - use single material
|
||||
$materialCombination = $rowData['ru_1'];
|
||||
} else {
|
||||
// Different materials - use combination
|
||||
$materialCombination = $rowData['ru_1'] . "+" . $rowData['ru_2'];
|
||||
}
|
||||
|
||||
Log::debug("[$logKey] Material combination check", [
|
||||
'ru_1' => $rowData['ru_1'],
|
||||
'ru_2' => $rowData['ru_2'],
|
||||
'is_same_material' => $isSameMaterial,
|
||||
'material_combination' => $materialCombination
|
||||
]);
|
||||
```
|
||||
|
||||
**2. Parsing Qualified Materials (Lines 56-68):**
|
||||
```php
|
||||
foreach ($qualifiedMaterialsList as $combo) {
|
||||
$combo = trim($combo);
|
||||
$parts = explode("+", $combo);
|
||||
|
||||
if (count($parts) == 2) {
|
||||
// Different materials combination
|
||||
$qualifiedCombinations[] = ['mat1' => trim($parts[0]), 'mat2' => trim($parts[1])];
|
||||
} elseif (count($parts) == 1) {
|
||||
// Single material (same on both sides)
|
||||
$qualifiedCombinations[] = ['mat1' => trim($parts[0]), 'mat2' => trim($parts[0])];
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**3. Adding Original Combination (Lines 71-78):**
|
||||
```php
|
||||
if ($isSameMaterial) {
|
||||
// Same material - add only once (no reverse needed)
|
||||
$qualifiedCombinations[] = ['mat1' => $rowData['ru_1'], 'mat2' => $rowData['ru_2']];
|
||||
} else {
|
||||
// Different materials - add both original and reverse
|
||||
$qualifiedCombinations[] = ['mat1' => $rowData['ru_1'], 'mat2' => $rowData['ru_2']];
|
||||
$qualifiedCombinations[] = ['mat1' => $rowData['ru_2'], 'mat2' => $rowData['ru_1']];
|
||||
}
|
||||
```
|
||||
|
||||
#### Example Scenarios
|
||||
|
||||
| Input ru_1 | Input ru_2 | Material Combination | Qualified Combinations Count | Notes |
|
||||
|------------|------------|---------------------|------------------------------|-------|
|
||||
| `9(M11)` | `9(M11)` | `"9(M11)"` | 1 | Single material, no reverse needed |
|
||||
| `8(M11)` | `8(M11)` | `"8(M11)"` | 1 | Single material, no reverse needed |
|
||||
| `1(M01)` | `1(M01)` | `"1(M01)"` | 1 | Single material, no reverse needed |
|
||||
| `1(M01)` | `9(M11)` | `"1(M01)+9(M11)"` | 2+ | Combination + reverse + qualified |
|
||||
|
||||
#### Database Storage Format
|
||||
|
||||
**material_group_maps table:**
|
||||
|
||||
| Scenario | material_name | qualified_materials | Description |
|
||||
|----------|---------------|---------------------|-------------|
|
||||
| Same Material | `9(M11)` | `8(M11),11(M11),9(M11),11(M51)` | Single material entry |
|
||||
| Different Materials | `1(M01)+9(M11)` | `1(M01)+8(M11),1(M01)+9(M11),1(M01)+11(M11)` | Combination entry |
|
||||
|
||||
#### Benefits
|
||||
|
||||
✅ **Correct Database Lookup:** Finds records for same materials
|
||||
✅ **No Duplicate Combinations:** Single material doesn't add reverse unnecessarily
|
||||
✅ **Proper Qualified Materials:** Parses both single materials and combinations
|
||||
✅ **Optimized Queries:** Fewer redundant combinations in qualified array
|
||||
|
||||
---
|
||||
|
||||
### 🇹🇷 Türkçe
|
||||
|
||||
Her iki malzeme grubu aynı olduğunda (örn: `ru_1 = "9(M11)"` ve `ru_2 = "9(M11)"`), sistem bu durumu malzeme kombinasyonlarından farklı şekilde ele almalıdır.
|
||||
|
||||
#### Problem
|
||||
|
||||
**Yanlış Yaklaşım:**
|
||||
```php
|
||||
// Her zaman "+" ile birleştirme
|
||||
$materialCombination = $ru1 . "+" . $ru2;
|
||||
// Sonuç: "9(M11)+9(M11)" ❌
|
||||
```
|
||||
|
||||
Bu şu sorunları yaratır:
|
||||
- Veritabanı aynı malzemeleri tek giriş olarak saklar: `"9(M11)"`
|
||||
- `"9(M11)+9(M11)"` araması kaydı bulamaz
|
||||
- Qualified materials döndürülmez
|
||||
- Kaynakçı ataması başarısız olur
|
||||
|
||||
#### Çözüm
|
||||
|
||||
**Doğru Yaklaşım:**
|
||||
```php
|
||||
// Malzemelerin aynı olup olmadığını kontrol et
|
||||
$isSameMaterial = ($ru1 === $ru2);
|
||||
|
||||
if ($isSameMaterial) {
|
||||
// Her iki tarafta aynı malzeme - tek malzeme kullan
|
||||
$materialCombination = $ru1; // "9(M11)" ✅
|
||||
} else {
|
||||
// Farklı malzemeler - kombinasyon kullan
|
||||
$materialCombination = $ru1 . "+" . $ru2; // "1(M01)+9(M11)" ✅
|
||||
}
|
||||
```
|
||||
|
||||
#### Uygulama Detayları
|
||||
|
||||
**1. Malzeme Kombinasyon Kontrolü (welder_1.php'de 33-41. satırlar):**
|
||||
```php
|
||||
$isSameMaterial = ($rowData['ru_1'] === $rowData['ru_2']);
|
||||
|
||||
if ($isSameMaterial) {
|
||||
// Her iki tarafta aynı malzeme - tek malzeme kullan
|
||||
$materialCombination = $rowData['ru_1'];
|
||||
} else {
|
||||
// Farklı malzemeler - kombinasyon kullan
|
||||
$materialCombination = $rowData['ru_1'] . "+" . $rowData['ru_2'];
|
||||
}
|
||||
|
||||
Log::debug("[$logKey] Material combination check", [
|
||||
'ru_1' => $rowData['ru_1'],
|
||||
'ru_2' => $rowData['ru_2'],
|
||||
'is_same_material' => $isSameMaterial,
|
||||
'material_combination' => $materialCombination
|
||||
]);
|
||||
```
|
||||
|
||||
**2. Qualified Materials Parse Etme (56-68. satırlar):**
|
||||
```php
|
||||
foreach ($qualifiedMaterialsList as $combo) {
|
||||
$combo = trim($combo);
|
||||
$parts = explode("+", $combo);
|
||||
|
||||
if (count($parts) == 2) {
|
||||
// Farklı malzeme kombinasyonu
|
||||
$qualifiedCombinations[] = ['mat1' => trim($parts[0]), 'mat2' => trim($parts[1])];
|
||||
} elseif (count($parts) == 1) {
|
||||
// Tek malzeme (her iki tarafta aynı)
|
||||
$qualifiedCombinations[] = ['mat1' => trim($parts[0]), 'mat2' => trim($parts[0])];
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**3. Orijinal Kombinasyonu Ekleme (71-78. satırlar):**
|
||||
```php
|
||||
if ($isSameMaterial) {
|
||||
// Aynı malzeme - sadece bir kez ekle (reverse gerekli değil)
|
||||
$qualifiedCombinations[] = ['mat1' => $rowData['ru_1'], 'mat2' => $rowData['ru_2']];
|
||||
} else {
|
||||
// Farklı malzemeler - hem orijinal hem reverse ekle
|
||||
$qualifiedCombinations[] = ['mat1' => $rowData['ru_1'], 'mat2' => $rowData['ru_2']];
|
||||
$qualifiedCombinations[] = ['mat1' => $rowData['ru_2'], 'mat2' => $rowData['ru_1']];
|
||||
}
|
||||
```
|
||||
|
||||
#### Örnek Senaryolar
|
||||
|
||||
| Giriş ru_1 | Giriş ru_2 | Malzeme Kombinasyonu | Qualified Kombinasyon Sayısı | Notlar |
|
||||
|------------|------------|---------------------|------------------------------|--------|
|
||||
| `9(M11)` | `9(M11)` | `"9(M11)"` | 1 | Tek malzeme, reverse gerekli değil |
|
||||
| `8(M11)` | `8(M11)` | `"8(M11)"` | 1 | Tek malzeme, reverse gerekli değil |
|
||||
| `1(M01)` | `1(M01)` | `"1(M01)"` | 1 | Tek malzeme, reverse gerekli değil |
|
||||
| `1(M01)` | `9(M11)` | `"1(M01)+9(M11)"` | 2+ | Kombinasyon + reverse + qualified |
|
||||
|
||||
#### Veritabanı Saklama Formatı
|
||||
|
||||
**material_group_maps tablosu:**
|
||||
|
||||
| Senaryo | material_name | qualified_materials | Açıklama |
|
||||
|---------|---------------|---------------------|----------|
|
||||
| Aynı Malzeme | `9(M11)` | `8(M11),11(M11),9(M11),11(M51)` | Tek malzeme girişi |
|
||||
| Farklı Malzemeler | `1(M01)+9(M11)` | `1(M01)+8(M11),1(M01)+9(M11),1(M01)+11(M11)` | Kombinasyon girişi |
|
||||
|
||||
#### Faydaları
|
||||
|
||||
✅ **Doğru Veritabanı Sorgusu:** Aynı malzemeler için kayıtları bulur
|
||||
✅ **Gereksiz Tekrar Yok:** Tek malzeme için reverse eklenmez
|
||||
✅ **Doğru Qualified Materials:** Hem tek malzeme hem kombinasyonları parse eder
|
||||
✅ **Optimize Sorgular:** Qualified array'de daha az gereksiz kombinasyon
|
||||
|
||||
---
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Always Check for Exact Combination First**
|
||||
- Use the full combination string (e.g., `"1(M01)+9(M11)"`)
|
||||
- Don't separate into individual materials first
|
||||
|
||||
2. **Handle Same Materials Correctly**
|
||||
- Check if both materials are identical before concatenating
|
||||
- Use single material name for same materials (e.g., `"9(M11)"`)
|
||||
- Use combination format only for different materials (e.g., `"1(M01)+9(M11)"`)
|
||||
|
||||
3. **Parse Qualified Materials Correctly**
|
||||
- Split by comma for multiple combinations
|
||||
- Split each combination by `+` for material pairs
|
||||
- Handle both single materials (count($parts) == 1) and combinations (count($parts) == 2)
|
||||
- Validate the structure of each qualified material
|
||||
|
||||
4. **Include Original Combination**
|
||||
- Always add the input combination to qualified list
|
||||
- For different materials: include both forward and reverse (ru1+ru2 and ru2+ru1)
|
||||
- For same materials: include only once (no reverse needed)
|
||||
|
||||
5. **Avoid Nested Loops**
|
||||
- Never use nested foreach over material arrays
|
||||
- Use specific combination matching only
|
||||
|
||||
6. **Log for Debugging**
|
||||
- Log qualified combinations found
|
||||
- Log number of combinations (should be reasonable, not N²)
|
||||
- Compare results with expected database records
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Problem: Too Many Welders Returned
|
||||
|
||||
**Symptom:** Welder dropdown shows 20+ options when database only has 9 records
|
||||
|
||||
**Cause:** Nested foreach creating N² combinations
|
||||
|
||||
**Solution:**
|
||||
- Check if exact combination matching is being used
|
||||
- Verify no nested loops over material arrays
|
||||
- Log the `qualifiedCombinations` array count
|
||||
|
||||
### Problem: No Welders Found
|
||||
|
||||
**Symptom:** Welder dropdown is empty or shows error
|
||||
|
||||
**Possible Causes:**
|
||||
1. Material combination not in `material_group_maps` table
|
||||
2. Typo in material names
|
||||
3. Wrong separator (should be `+` for combinations)
|
||||
|
||||
**Solution:**
|
||||
- Check if combination exists in database
|
||||
- Verify the query includes original combination as fallback
|
||||
- Review log output for material matching
|
||||
|
||||
### Problem: Inconsistent Results
|
||||
|
||||
**Symptom:** Different results between welder assignment and qualification table
|
||||
|
||||
**Cause:** Different query logic between modules
|
||||
|
||||
**Solution:**
|
||||
- Ensure both use same `qualifiedCombinations` approach
|
||||
- Verify both include same criteria (diameter, thickness, etc.)
|
||||
- Check groupBy clauses match
|
||||
|
||||
## Migration Notes
|
||||
|
||||
When updating existing code from old to new approach:
|
||||
|
||||
1. **Remove** nested foreach loops over materials
|
||||
2. **Add** exact combination matching logic
|
||||
3. **Update** query to use `qualifiedCombinations` array
|
||||
4. **Test** with known material combinations
|
||||
5. **Compare** results with database record counts
|
||||
6. **Verify** log output shows reasonable combination counts
|
||||
|
||||
## Related Files
|
||||
|
||||
- `app/Functions/material-group-map.php` - Helper function (legacy, consider deprecating)
|
||||
- `app/Http/Controllers/AutoCompleteType/welder-assignment/welder_1.php` - Welder autocomplete
|
||||
- `resources/views/admin-ajax/welder-qualification-table.blade.php` - Qualification table display
|
||||
- `resources/views/admin/type/welder-qualification-table.blade.php` - Main qualification page
|
||||
|
||||
## Conclusion
|
||||
|
||||
The Material Group Map system is critical for accurate welder assignment. The key is to use **exact combination matching** rather than generating all possible combinations from individual materials. This ensures predictable, accurate results that match the database and welding qualification standards.
|
||||
|
||||
---
|
||||
|
||||
# User Guide: Material Group Map System Issue & Solution
|
||||
|
||||
## 🇬🇧 English Version
|
||||
|
||||
### What Was the Problem?
|
||||
|
||||
When using the **Welder Assignment** feature in the system, users experienced an inconsistency where the dropdown list showed significantly more welders than actually existed in the database.
|
||||
|
||||
#### Observed Symptoms
|
||||
|
||||
**Scenario:**
|
||||
- **Material Group 1:** `1(M01)`
|
||||
- **Material Group 2:** `9(M11)`
|
||||
|
||||
**In Welder Qualification Table:**
|
||||
- Shows **9 welder records** ✅
|
||||
|
||||
**In Welder Assignment Dropdown:**
|
||||
- Shows **26+ welder records** ❌
|
||||
|
||||
This discrepancy caused:
|
||||
- Confusion about which welders are actually qualified
|
||||
- Incorrect welder suggestions
|
||||
- System reliability concerns
|
||||
- Difficulty in selecting the correct welder
|
||||
|
||||
### Why Did This Happen?
|
||||
|
||||
#### Technical Explanation
|
||||
|
||||
The system was using an incorrect method called "nested foreach loop" which created what we call an **N² combination explosion**.
|
||||
|
||||
**The Wrong Logic:**
|
||||
1. System would take materials from both groups separately
|
||||
2. Example: `["1(M01)", "8(M11)", "9(M11)", "11(M11)", "11(M51)"]` (5 materials)
|
||||
3. Then create ALL possible combinations by matching each material with every other material
|
||||
4. This created: 5 × 5 = **25 different combinations**
|
||||
|
||||
**Why This Was Wrong:**
|
||||
Most of these 25 combinations were invalid or unintended. For example:
|
||||
- `8(M11)` + `8(M11)` ❌ (same material twice)
|
||||
- `1(M01)` + `11(M51)` ❌ (unrelated combination)
|
||||
- `8(M11)` + `11(M51)` ❌ (not a valid qualification)
|
||||
|
||||
However, the system would search for welders qualified for ALL these combinations, resulting in too many results.
|
||||
|
||||
### The Solution
|
||||
|
||||
We implemented **Exact Combination Matching** approach:
|
||||
|
||||
#### How It Works Now
|
||||
|
||||
1. **Check for Exact Combination**
|
||||
- System looks for the specific combination: `"1(M01)+9(M11)"`
|
||||
- Searches in the Material Group Map table
|
||||
|
||||
2. **Get Qualified Materials for That Specific Combination**
|
||||
- If found, retrieves only the qualified materials listed for that exact combination
|
||||
- Example: `"1(M01)+8(M11), 1(M01)+9(M11), 1(M01)+11(M11)"` (3 combinations)
|
||||
|
||||
3. **Search Only for These Specific Combinations**
|
||||
- Plus the reverse of the original combination
|
||||
- Total: **5 specific combinations** (not 25!)
|
||||
|
||||
#### Benefits
|
||||
|
||||
✅ **Accurate Results:** Now returns correct 9 records
|
||||
✅ **Consistent:** Matches the Welder Qualification Table
|
||||
✅ **Faster:** Fewer database queries
|
||||
✅ **Reliable:** Only shows welders who are actually qualified
|
||||
|
||||
### Comparison
|
||||
|
||||
| Aspect | Old Method (Wrong) | New Method (Correct) |
|
||||
|--------|-------------------|---------------------|
|
||||
| Combinations Created | 25 (5×5) | 5 (specific only) |
|
||||
| Welders Returned | 26+ records | 9 records |
|
||||
| Logic | Try all possible pairs | Only valid combinations |
|
||||
| Consistency | ❌ Different from qualification table | ✅ Same as qualification table |
|
||||
| Performance | ❌ Excessive queries | ✅ Optimized |
|
||||
|
||||
### What This Means for Users
|
||||
|
||||
**Before Fix:**
|
||||
- Welder dropdown showed too many options
|
||||
- Difficult to find the right welder
|
||||
- Some shown welders might not actually be qualified
|
||||
|
||||
**After Fix:**
|
||||
- Welder dropdown shows only qualified welders
|
||||
- Easy to select the correct welder
|
||||
- System is consistent across all modules
|
||||
- Better performance and reliability
|
||||
|
||||
---
|
||||
|
||||
## 🇹🇷 Türkçe Versiyon
|
||||
|
||||
### Sorun Neydi?
|
||||
|
||||
Sistemdeki **Kaynakçı Ataması (Welder Assignment)** özelliğini kullanırken, açılır listede veritabanında gerçekte var olandan çok daha fazla kaynakçı görüntüleniyordu.
|
||||
|
||||
#### Gözlemlenen Belirtiler
|
||||
|
||||
**Senaryo:**
|
||||
- **Material Group 1:** `1(M01)`
|
||||
- **Material Group 2:** `9(M11)`
|
||||
|
||||
**Kaynakçı Yeterlilik Tablosunda (Welder Qualification Table):**
|
||||
- **9 kaynakçı kaydı** gösteriliyor ✅
|
||||
|
||||
**Kaynakçı Atama Açılır Listesinde (Welder Assignment Dropdown):**
|
||||
- **26+ kaynakçı kaydı** gösteriliyor ❌
|
||||
|
||||
Bu tutarsızlık şu sorunlara neden oluyordu:
|
||||
- Hangi kaynakçıların gerçekten yeterli olduğu konusunda kafa karışıklığı
|
||||
- Yanlış kaynakçı önerileri
|
||||
- Sistem güvenilirliği endişeleri
|
||||
- Doğru kaynakçıyı seçmekte zorluk
|
||||
|
||||
### Neden Oldu?
|
||||
|
||||
#### Teknik Açıklama
|
||||
|
||||
Sistem, **N² kombinasyon patlaması** dediğimiz durumu yaratan "iç içe foreach döngüsü" adlı yanlış bir yöntem kullanıyordu.
|
||||
|
||||
**Yanlış Mantık:**
|
||||
1. Sistem, her iki gruptan malzemeleri ayrı ayrı alıyordu
|
||||
2. Örnek: `["1(M01)", "8(M11)", "9(M11)", "11(M11)", "11(M51)"]` (5 malzeme)
|
||||
3. Sonra her malzemeyi diğer her malzeme ile eşleştirerek TÜM olası kombinasyonları oluşturuyordu
|
||||
4. Bu şunu üretiyordu: 5 × 5 = **25 farklı kombinasyon**
|
||||
|
||||
**Neden Yanlıştı:**
|
||||
Bu 25 kombinasyonun çoğu geçersiz veya istenmeyen kombinasyonlardı. Örneğin:
|
||||
- `8(M11)` + `8(M11)` ❌ (aynı malzeme iki kez)
|
||||
- `1(M01)` + `11(M51)` ❌ (ilgisiz kombinasyon)
|
||||
- `8(M11)` + `11(M51)` ❌ (geçerli bir yeterlilik değil)
|
||||
|
||||
Ancak sistem TÜM bu kombinasyonlar için yeterli kaynakçıları arıyordu, bu da çok fazla sonuç döndürülmesine yol açıyordu.
|
||||
|
||||
### Çözüm
|
||||
|
||||
**Tam Kombinasyon Eşleştirme (Exact Combination Matching)** yaklaşımını uyguladık:
|
||||
|
||||
#### Şimdi Nasıl Çalışıyor
|
||||
|
||||
1. **Tam Kombinasyonu Kontrol Et**
|
||||
- Sistem spesifik kombinasyonu arar: `"1(M01)+9(M11)"`
|
||||
- Material Group Map tablosunda arama yapar
|
||||
|
||||
2. **Bu Spesifik Kombinasyon İçin Yeterli Malzemeleri Al**
|
||||
- Bulunursa, sadece o tam kombinasyon için listelenen yeterli malzemeleri alır
|
||||
- Örnek: `"1(M01)+8(M11), 1(M01)+9(M11), 1(M01)+11(M11)"` (3 kombinasyon)
|
||||
|
||||
3. **Sadece Bu Spesifik Kombinasyonları Ara**
|
||||
- Artı orijinal kombinasyonun tersi
|
||||
- Toplam: **5 spesifik kombinasyon** (25 değil!)
|
||||
|
||||
#### Faydaları
|
||||
|
||||
✅ **Doğru Sonuçlar:** Artık doğru 9 kayıt döndürüyor
|
||||
✅ **Tutarlı:** Kaynakçı Yeterlilik Tablosu ile eşleşiyor
|
||||
✅ **Daha Hızlı:** Daha az veritabanı sorgusu
|
||||
✅ **Güvenilir:** Sadece gerçekten yeterli olan kaynakçıları gösteriyor
|
||||
|
||||
### Karşılaştırma
|
||||
|
||||
| Özellik | Eski Yöntem (Yanlış) | Yeni Yöntem (Doğru) |
|
||||
|---------|---------------------|---------------------|
|
||||
| Oluşturulan Kombinasyonlar | 25 (5×5) | 5 (sadece spesifik) |
|
||||
| Dönen Kaynakçı Sayısı | 26+ kayıt | 9 kayıt |
|
||||
| Mantık | Tüm olası çiftleri dene | Sadece geçerli kombinasyonlar |
|
||||
| Tutarlılık | ❌ Yeterlilik tablosundan farklı | ✅ Yeterlilik tablosu ile aynı |
|
||||
| Performans | ❌ Aşırı sorgu | ✅ Optimize edilmiş |
|
||||
|
||||
### Kullanıcılar İçin Ne Anlama Geliyor
|
||||
|
||||
**Düzeltme Öncesi:**
|
||||
- Kaynakçı açılır listesi çok fazla seçenek gösteriyordu
|
||||
- Doğru kaynakçıyı bulmak zordu
|
||||
- Gösterilen bazı kaynakçılar aslında yeterli olmayabiliyordu
|
||||
|
||||
**Düzeltme Sonrası:**
|
||||
- Kaynakçı açılır listesi sadece yeterli kaynakçıları gösteriyor
|
||||
- Doğru kaynakçıyı seçmek kolay
|
||||
- Sistem tüm modüllerde tutarlı
|
||||
- Daha iyi performans ve güvenilirlik
|
||||
|
||||
### Özet
|
||||
|
||||
Bu düzeltme, sistemin kaynakçı atama işlevini daha doğru, daha hızlı ve kullanıcılar için daha güvenilir hale getirdi. Artık sadece gerçekten o iş için yeterli olan kaynakçıları göreceksiniz!
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Same Material Issue & Solution
|
||||
|
||||
### 🇬🇧 English Version
|
||||
|
||||
#### What Was the Problem?
|
||||
|
||||
When both material groups were identical (e.g., Material 1: `9(M11)`, Material 2: `9(M11)`), the system was incorrectly creating a combination string `"9(M11)+9(M11)"` which didn't exist in the database. The database stores same materials as single entries like `"9(M11)"`.
|
||||
|
||||
#### Impact
|
||||
|
||||
**Before Fix:**
|
||||
- Searching for `"9(M11)+9(M11)"` → **No match found** ❌
|
||||
- No qualified materials returned
|
||||
- Welder assignment failed for same-material joints
|
||||
- Users couldn't select welders for identical material combinations
|
||||
|
||||
**Example Affected Cases:**
|
||||
- `9(M11)` + `9(M11)` → No welders shown ❌
|
||||
- `8(M11)` + `8(M11)` → No welders shown ❌
|
||||
- `1(M01)` + `1(M01)` → No welders shown ❌
|
||||
|
||||
#### The Solution
|
||||
|
||||
Added material identity check before creating the search string:
|
||||
|
||||
```php
|
||||
// Check if materials are identical
|
||||
if ($ru1 === $ru2) {
|
||||
$materialCombination = $ru1; // Single material: "9(M11)"
|
||||
} else {
|
||||
$materialCombination = $ru1 . "+" . $ru2; // Combination: "1(M01)+9(M11)"
|
||||
}
|
||||
```
|
||||
|
||||
#### Benefits
|
||||
|
||||
✅ **Works for Same Materials:** Now correctly finds records when both materials are identical
|
||||
✅ **Works for Different Materials:** Still works correctly for material combinations
|
||||
✅ **Correct Database Lookup:** Searches with the right format in both cases
|
||||
✅ **No Redundant Combinations:** Doesn't add reverse for same materials (no need for `9(M11)+9(M11)` reverse)
|
||||
✅ **Complete Coverage:** All material scenarios now work correctly
|
||||
|
||||
#### Comparison Table
|
||||
|
||||
| Scenario | Material 1 | Material 2 | Old Search String | New Search String | Result |
|
||||
|----------|------------|------------|------------------|-------------------|---------|
|
||||
| Same Material | `9(M11)` | `9(M11)` | `"9(M11)+9(M11)"` ❌ | `"9(M11)"` ✅ | **Fixed** |
|
||||
| Same Material | `8(M11)` | `8(M11)` | `"8(M11)+8(M11)"` ❌ | `"8(M11)"` ✅ | **Fixed** |
|
||||
| Different Materials | `1(M01)` | `9(M11)` | `"1(M01)+9(M11)"` ✅ | `"1(M01)+9(M11)"` ✅ | **Still Works** |
|
||||
|
||||
---
|
||||
|
||||
### 🇹🇷 Türkçe Versiyon
|
||||
|
||||
#### Problem Neydi?
|
||||
|
||||
Her iki malzeme grubu aynı olduğunda (örn: Malzeme 1: `9(M11)`, Malzeme 2: `9(M11)`), sistem yanlış şekilde `"9(M11)+9(M11)"` kombinasyon stringi oluşturuyordu. Bu string veritabanında mevcut değil. Veritabanı aynı malzemeleri `"9(M11)"` gibi tek giriş olarak saklar.
|
||||
|
||||
#### Etki
|
||||
|
||||
**Düzeltme Öncesi:**
|
||||
- `"9(M11)+9(M11)"` araması → **Eşleşme bulunamadı** ❌
|
||||
- Qualified materials döndürülmedi
|
||||
- Aynı malzemeli kaynak noktaları için kaynakçı ataması başarısız oldu
|
||||
- Kullanıcılar aynı malzeme kombinasyonları için kaynakçı seçemedi
|
||||
|
||||
**Etkilenen Örnek Durumlar:**
|
||||
- `9(M11)` + `9(M11)` → Hiç kaynakçı gösterilmedi ❌
|
||||
- `8(M11)` + `8(M11)` → Hiç kaynakçı gösterilmedi ❌
|
||||
- `1(M01)` + `1(M01)` → Hiç kaynakçı gösterilmedi ❌
|
||||
|
||||
#### Çözüm
|
||||
|
||||
Arama string'i oluşturmadan önce malzeme kimlik kontrolü eklendi:
|
||||
|
||||
```php
|
||||
// Malzemelerin aynı olup olmadığını kontrol et
|
||||
if ($ru1 === $ru2) {
|
||||
$materialCombination = $ru1; // Tek malzeme: "9(M11)"
|
||||
} else {
|
||||
$materialCombination = $ru1 . "+" . $ru2; // Kombinasyon: "1(M01)+9(M11)"
|
||||
}
|
||||
```
|
||||
|
||||
#### Faydaları
|
||||
|
||||
✅ **Aynı Malzemeler İçin Çalışır:** Artık her iki malzeme aynı olduğunda kayıtları doğru buluyor
|
||||
✅ **Farklı Malzemeler İçin Çalışır:** Malzeme kombinasyonları için hala doğru çalışıyor
|
||||
✅ **Doğru Veritabanı Sorgusu:** Her iki durumda da doğru formatla arama yapıyor
|
||||
✅ **Gereksiz Kombinasyon Yok:** Aynı malzemeler için reverse eklemiyor (9(M11)+9(M11) reverse'üne gerek yok)
|
||||
✅ **Tam Kapsama:** Tüm malzeme senaryoları artık doğru çalışıyor
|
||||
|
||||
#### Karşılaştırma Tablosu
|
||||
|
||||
| Senaryo | Malzeme 1 | Malzeme 2 | Eski Arama String'i | Yeni Arama String'i | Sonuç |
|
||||
|---------|-----------|-----------|---------------------|---------------------|-------|
|
||||
| Aynı Malzeme | `9(M11)` | `9(M11)` | `"9(M11)+9(M11)"` ❌ | `"9(M11)"` ✅ | **Düzeltildi** |
|
||||
| Aynı Malzeme | `8(M11)` | `8(M11)` | `"8(M11)+8(M11)"` ❌ | `"8(M11)"` ✅ | **Düzeltildi** |
|
||||
| Farklı Malzemeler | `1(M01)` | `9(M11)` | `"1(M01)+9(M11)"` ✅ | `"1(M01)+9(M11)"` ✅ | **Hala Çalışıyor** |
|
||||
|
||||
---
|
||||
|
||||
**Date:** 2025-10-29
|
||||
**File:** `app/Http/Controllers/AutoCompleteType/welder-assignment/welder_1.php`
|
||||
**Lines Modified:** 30-88
|
||||
**Status:** ✅ Resolved
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
# Material Performance User Guide
|
||||
|
||||
## What is the Material Performance Module?
|
||||
|
||||
The Material Performance module tracks and analyzes material performance data throughout the project lifecycle. This module helps monitor material behavior, track performance metrics, and ensure material quality and compliance with project requirements.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Material Performance:
|
||||
1. Login to the system
|
||||
2. Click on **Dashboard** in the main menu
|
||||
3. Select **Material Performance** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Performance Tracking**: Track material performance metrics and data
|
||||
- **Quality Monitoring**: Monitor material quality and behavior
|
||||
- **Data Analysis**: Analyze material performance trends and patterns
|
||||
- **Report Generation**: Generate material performance reports
|
||||
|
||||
### Secondary Functions
|
||||
- **Performance Alerts**: Alert when material performance is below standards
|
||||
- **Trend Analysis**: Analyze material performance trends over time
|
||||
- **Compliance Monitoring**: Ensure material compliance with specifications
|
||||
- **Documentation**: Maintain material performance records
|
||||
|
||||
## How to Use
|
||||
|
||||
### Recording Material Performance
|
||||
1. Click **"New Performance Record"** button
|
||||
2. Select material type and batch
|
||||
3. Enter performance test results
|
||||
4. Record environmental conditions
|
||||
5. Add performance observations
|
||||
6. Save performance record
|
||||
|
||||
### Performance Analysis
|
||||
1. Review material performance data
|
||||
2. Analyze performance trends
|
||||
3. Compare with specifications
|
||||
4. Identify performance issues
|
||||
5. Generate performance reports
|
||||
|
||||
### Performance Categories
|
||||
- **Mechanical Properties**: Strength, hardness, toughness
|
||||
- **Chemical Properties**: Composition, corrosion resistance
|
||||
- **Physical Properties**: Density, thermal properties
|
||||
- **Service Performance**: Performance in actual service conditions
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Record performance data accurately and consistently
|
||||
- ✅ Monitor performance trends regularly
|
||||
- ✅ Compare performance with specifications
|
||||
- ✅ Document any performance issues or deviations
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify performance test accuracy
|
||||
- ✅ Check performance against specifications
|
||||
- ✅ Monitor performance trends and patterns
|
||||
- ✅ Regular review of performance data
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Performance below standards**: Review material specifications and processing
|
||||
2. **Data recording errors**: Check test procedures and equipment
|
||||
3. **Trend analysis issues**: Verify data consistency and completeness
|
||||
|
||||
### Getting Help
|
||||
- Contact the Quality Control department for technical support
|
||||
- Consult material specifications and performance standards
|
||||
- Check performance test procedures and equipment
|
||||
@@ -1,77 +0,0 @@
|
||||
# Material Planning User Guide
|
||||
|
||||
## What is the Material Planning Module?
|
||||
|
||||
The Material Planning module manages material planning and scheduling for manufacturing operations. This module helps optimize material usage, plan material requirements, and ensure timely material availability for production activities.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Material Planning:
|
||||
1. Login to the system
|
||||
2. Click on **Manufacturing** in the main menu
|
||||
3. Select **Material Planning** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Material Requirements Planning**: Plan material requirements for production
|
||||
- **Inventory Management**: Manage material inventory and stock levels
|
||||
- **Procurement Planning**: Plan material procurement and ordering
|
||||
- **Schedule Optimization**: Optimize material delivery schedules
|
||||
|
||||
### Secondary Functions
|
||||
- **Supplier Management**: Manage material suppliers and performance
|
||||
- **Cost Analysis**: Analyze material costs and optimization opportunities
|
||||
- **Forecasting**: Forecast material requirements and demand
|
||||
- **Reporting**: Generate material planning reports and analytics
|
||||
|
||||
## How to Use
|
||||
|
||||
### Creating Material Plans
|
||||
1. Click **"New Material Plan"** button
|
||||
2. Select project and production requirements
|
||||
3. Define material specifications and quantities
|
||||
4. Set delivery schedules and priorities
|
||||
5. Assign suppliers and procurement responsibilities
|
||||
6. Submit plan for approval
|
||||
7. Track plan execution
|
||||
|
||||
### Material Planning Process
|
||||
1. Review production requirements and schedules
|
||||
2. Calculate material requirements and quantities
|
||||
3. Check current inventory levels
|
||||
4. Plan procurement and delivery schedules
|
||||
5. Monitor plan execution and progress
|
||||
6. Update plans as needed
|
||||
|
||||
### Planning Categories
|
||||
- **Raw Materials**: Planning for raw material requirements
|
||||
- **Consumables**: Planning for consumable materials
|
||||
- **Equipment**: Planning for equipment and tools
|
||||
- **Special Materials**: Planning for special or critical materials
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Plan material requirements in advance
|
||||
- ✅ Monitor inventory levels regularly
|
||||
- ✅ Optimize material usage and minimize waste
|
||||
- ✅ Maintain good supplier relationships
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify material specifications and quality
|
||||
- ✅ Check supplier performance and reliability
|
||||
- ✅ Monitor material costs and optimization
|
||||
- ✅ Regular review of material planning processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Material shortage**: Check inventory levels and procurement schedules
|
||||
2. **Delivery delays**: Contact suppliers and review delivery schedules
|
||||
3. **Quality issues**: Review material specifications and supplier performance
|
||||
|
||||
### Getting Help
|
||||
- Contact the Manufacturing department for technical support
|
||||
- Consult material planning procedures and standards
|
||||
- Check inventory levels and supplier performance
|
||||
@@ -1,75 +0,0 @@
|
||||
## Mechanical Controls – Consolidated Guide
|
||||
|
||||
### 1. Amaç ve Kapsam
|
||||
- **Hedef:** BJ/FJ/TH/CJ gibi mekanik eklemler, tüm modüllerde (Weldlog, Weldmap, Repair Log, NDT/Spool/Paint süreçleri, register & cron görevleri) kaynaklı sayımları, SUM/AVG hesaplarını ve senkronizasyonları etkilemesin.
|
||||
- **Veri Kaynağı:** `weld_logs.type_of_welds` alanı; `JointTypeService` üzerinden `weldedTypes` / `mechanicalTypes` listeleri.
|
||||
- **Temel Strateji:** Tüm sorguların `apply_welded_filter()` veya `apply_mechanical_filter()` yardımıyla aynı servis katmanına bağlanması + DevExtreme gridlerinde `weldedOnly` özetleri.
|
||||
|
||||
### 2. Mimari Özeti
|
||||
| Katman | Dosyalar | İşlev |
|
||||
| --- | --- | --- |
|
||||
| Servis & Helper | `app/Services/JointTypeService.php`, `app/Functions/joint_type_helpers.php`, `database/seeders/MechanicalJointTypesSeeder.php` | Ortak tip listeleri, `filterWelded/Mechanical`, `apply_welded_filter()` ve mekanik joint kayıtlarının seed edilmesi |
|
||||
| DevExtreme çekirdeği | `app/DevExtreme/AggregateHelper.php`, `app/DevExtreme/DbSet.php`, `app/DevExtreme/SummaryContext.php`, `resources/views/components/table/datagrid*.blade.php` | `weldedOnly` SUM/AVG, `type_of_welds` seçimi, mekanik satır davranışı |
|
||||
| Uygulama ekranları | `resources/views/admin/type/*`, `resources/views/admin-ajax/*` | Gridler + PDF/Excel üretimleri, tamamı helper’ı kullanır |
|
||||
| Arka plan işlemleri | `resources/views/cron/*.blade.php`, `app/Services/RegisterCreator/*`, `app/Http/Controllers/SaveTrigger/test_pack_base_statuses.php` | NDE, spool, paint, register senkronizasyonlarında mekanik filtreleme |
|
||||
| Komutlar & dokümantasyon | `app/Console/Commands/*`, `resources/views/guide/*.md` | Otomatik testler, raporlar ve bu kılavuz |
|
||||
|
||||
### 3. Ana Davranışlar
|
||||
1. **Grid Seviyesi**
|
||||
- `$enableMechanicalControls` → mekanik satırlar gri, kaynak alanları `readOnly`.
|
||||
- `$excludeMechanicalFromSummaries` → DevExtreme `totalItems` için `selector + weldedOnly`.
|
||||
- `type_of_welds` kolonu her istekte seçiliyor; `SummaryContext` parametresi (`excludeMechanicalSummary=1`) backend’e iletiliyor.
|
||||
2. **Sorgu Seviyesi**
|
||||
- Tüm `db("weld_logs")` ve `WeldLog::query()` kullanımları `apply_welded_filter()` ile sarıldı; mekanik senaryolar için `apply_mechanical_filter()` mevcut.
|
||||
- Cron/SaveTrigger/Register akışlarında da aynı helper kullanıldığından, veritabanı senkronizasyonları mekanik satırı asla tetiklemiyor.
|
||||
|
||||
### 4. Test ve Doğrulama
|
||||
- **Otomatik SUM/AVG kontrolü:**
|
||||
```
|
||||
php artisan mechanical:verify-summaries --columns=nps_1,nps_2,outside_diameter_1,outside_diameter_2,wall_thickness_1,wall_thickness_2
|
||||
```
|
||||
Çıktıdaki “SUM (Mechanical)” değerlerinin 0 olması beklenir; sonuçlar `weldlog-mechanical-summary.md` içinde saklanır.
|
||||
- **Manuel Grid Kontrolü:**
|
||||
- Weldlog/Weldmap/Base Weldmap: Gri `[MECH]` satırları, kilitli kaynak alanları ve doğru footer değerlerini gözlemleyin.
|
||||
- Repair Log, Spool Release, Manage NDT vs.: Şu an yalnızca `count` özetleri kullanıyor; gelecekte SUM/AVG eklerseniz aynı bayrakları aktifleştirin.
|
||||
- **Regresyon testi:** `php artisan tinker` veya özel SQL scriptleriyle mekanik toplamları karşılaştırın; fark oluşursa ilgili gridde `weldedOnly` konfigürasyonunu doğrulayın.
|
||||
|
||||
### 5. Modül Bazında Durum
|
||||
| Modül / Süreç | Durum | Not |
|
||||
| --- | --- | --- |
|
||||
| **Weldlog / Weldmap / Base Weldmap** | SUM/AVG tamamen kaynaklı veriden geliyor; CLI sonuçları dokümante edildi. |
|
||||
| **Repair Log** | Veri kümesi sadece kaynaklı kayıtlardan oluşuyor; izleme amaçlı tinker komutu hazır. |
|
||||
| **Spool & Paint akışları** | `spool-status-changer`, `paint-follow-up-updater`, tüm spool-release AJAX’ları helper kullanıyor; mekanik kayıtlar statü/pint süreçlerine girmez. |
|
||||
| **NDT / Manage NDT / NDT Order** | Gridler sadece `count` özetlerine sahip; veri kaynakları zaten helper’lı. Gelecekte SUM/AVG eklenirse bayraklar açılmalı. |
|
||||
| **NDE Matrix** | Mekanik satırlar veri bütünlüğü için korunuyor ancak `showMechanicalNdtPlaceholder` sayesinde test alanları otomatik “N/A – Non-Welded Connection” ile etiketleniyor. |
|
||||
| **Register Creator (QA/WDB)** | Belge tarama ve satır derleme aşamasında sadece kaynaklı kayıtlar okunuyor; gereksiz dosya taramaları engellendi. |
|
||||
| **Cron Senkronları** | Line list ↔ NDE ↔ weld log, spool, paint, repair senaryoları helper’a geçti; mekanik satırlar arka planda yok sayılıyor. |
|
||||
|
||||
### 6. Bakım Kontrol Listesi
|
||||
1. Yeni bir ekran/cron yazarken `db("weld_logs")` kullanacaksanız ilk satıra `apply_welded_filter()` koyun.
|
||||
2. DevExtreme gridine SUM/AVG eklerken:
|
||||
- `$enableMechanicalControls = true`, `$excludeMechanicalFromSummaries = true`, `$alwaysSelectColumns[] = 'type_of_welds'`.
|
||||
- `totalItems` için `selector` + `weldedOnly: true` atamayı unutmayın.
|
||||
3. Tip listeleri değişirse `php artisan cache:clear` veya `clear_joint_types_cache()` çağrısını tetikleyin; yeni ortam kurulurken `php artisan db:seed --class=MechanicalJointTypesSeeder` çalıştırmayı unutmayın.
|
||||
4. Rehberleri (bu dosya) güncel tutun; yeni kolonlar/testler eklendikçe tabloya değerleri ekleyin.
|
||||
|
||||
> Bu doküman, daha önce yayılan üç ayrı rehberin (DevExtreme davranışları, genel task özeti, SUM/AVG doğrulamaları) birleşik ve sadeleştirilmiş halidir. Tüm mekanik iş mantığına ait tek referans olarak kullanılmalıdır.
|
||||
|
||||
### 7. Güncel Dosya Değişiklikleri
|
||||
|
||||
| Dosya | Açıklama ve Neden |
|
||||
| --- | --- |
|
||||
| `resources/views/components/table/datagrid.blade.php` | DevExtreme gridleri için mekanik satırları gri yapma, kaynak alanlarını `readOnly` tutma ve SUM/AVG hesaplarında `weldedOnly` filtresini uygulama mantığı tek merkezde toplandı. Böylece tüm gridler aynı davranışı otomatik olarak devralıyor. |
|
||||
| `app/DevExtreme/AggregateHelper.php` & `app/DevExtreme/DbSet.php` | DevExtreme sunucu tarafı sorguları, `weldedOnly` bayrağı geldiğinde mekanik tipleri SQL seviyesinde `CASE WHEN` ile 0/NULL’a çeviriyor. Bu sayede footer SUM/AVG değerleri yalnızca kaynaklı kayıtları kapsıyor. |
|
||||
| `resources/views/components/table/datagrid/partials/js-data-source.blade.php` & `resources/views/admin/devextreme.php` | Grid isteklerine `excludeMechanicalSummary=1` parametresi eklenip backend’de `SummaryContext` ayarlanıyor; `type_of_welds` kolonunun her sorguda seçilmesi garanti edildi. |
|
||||
| `resources/views/admin/type/weldlog.blade.php`, `weldmap.blade.php`, `weldmap-fast2.blade.php`, `resources/views/admin/type/weldmap/main.blade.php` | Grid başlatılırken `$alwaysSelectColumns = ['type_of_welds']`, `$excludeMechanicalFromSummaries = true`, `$enableMechanicalControls = true` atandı. Ayrıca `type_of_welds` alanı için dropdown (joint_types + fallback listesi) geri getirildi, böylece mekanik tip seçimi hatasız yapılabiliyor. |
|
||||
| `resources/views/admin/type/nde-matrix.blade.php` | Mekanik satırlardaki NDT/PWHT kolonları otomatik olarak “N/A – Non-Welded Connection” placeholder’ıyla gösteriliyor; diğer satırlar normal veri taşıyor. |
|
||||
| `resources/views/admin-ajax/*`, `resources/views/cron/*`, `app/Http/Controllers/SaveTrigger/test_pack_base_statuses.php`, `app/Services/RegisterCreator/*` | Tüm sorgular `apply_welded_filter()` veya `apply_mechanical_filter()` yardımcılarını kullanacak şekilde güncellendi. Böylece mekanik kayıtlar spool, paint, register ve rapor çıktılarında yanlışlıkla hesaplamaya girmiyor. |
|
||||
| `app/Functions/joint_type_helpers.php`, `app/Services/JointTypeService.php` | Mekanik/kaynaklı tip listeleri cache’lenen servis katmanına taşındı; `apply_welded_filter()` fonksiyonu Eloquent/Query Builder üzerinde aynı mantığı tekrar kullanmamızı sağlıyor. |
|
||||
| `database/migrations/*`, `database/seeders/MechanicalJointTypesSeeder.php`, `database/seeders/DatabaseSeeder.php` | `joint_types` tablosuna mekanik bayraklar, `weld_logs` tablosuna `fitter_name` alanı eklendi; mekanik tiplerin varlığı garanti altına alındı (lokal ortamlar için seeder). |
|
||||
| `app/Console/Commands/VerifyMechanicalSummaries.php` | SUM/AVG doğrulaması CLI’dan otomatik çalıştırılabiliyor; rapor çıktıları guide’da saklanıyor. |
|
||||
| `resources/views/guide/mechanical-overview.md` (bu dosya) | Tüm mimari, test adımları ve değişiklik listesi tek referansta toplandı; sunum/handover sırasında kullanılmak üzere güncel tutuluyor. |
|
||||
|
||||
> Yukarıdaki dosyalar dışında listelenen vendor/composer değişiklikleri yeni servis sınıflarını çözümlemek için Composer autoload üretimi sırasında oluştu; ekteki kod yürütmesi için gerekli olup ek müdahale gerektirmiyor.
|
||||
|
||||
|
||||
@@ -1,193 +0,0 @@
|
||||
# Mobile Field Data Entry - User Guide
|
||||
|
||||
## Overview
|
||||
This guide explains how to use the mobile app screens for field data entry and updates.
|
||||
The mobile flows are module-based and optimized for fast, on-site updates.
|
||||
|
||||
## What's Included in This Branch
|
||||
- Added a dedicated **Weld Log Entry** flow that consolidates fit-up, welding, WPS, welder, and NDT fields in one form.
|
||||
- Added new module screens for **Punch**, **Repair**, **NDT Request**, **RFI Create**, **RFI Update**, **Ferrite**, **PMI**, and **Spool/NDT/Paint Release** entry/update.
|
||||
- Implemented consistent **mobile list + bottom sheet edit** pattern across modules.
|
||||
- Refactored photo upload using standard **InspectionDockedFab** for unified photo uploads.
|
||||
- Added **bulk update** support in Weld Log Entry (multi-select joints).
|
||||
- Added **filtering** (status/ISO) in list screens where applicable.
|
||||
- Standardized **API endpoints** to direct table endpoints (`/api/{table}/read|update|create`).
|
||||
- Added **field coverage** for NDT report/test metadata and welding report date.
|
||||
- Standardized **snackbar feedback** for save results and validation errors.
|
||||
|
||||
## Navigation
|
||||
Open the left sidebar menu or the Home grid and use the following entries:
|
||||
- Weld Log Entry
|
||||
- Punch Update
|
||||
- Repair Status Entry
|
||||
- NDT Request
|
||||
- RFI Create
|
||||
- RFI Update
|
||||
- Ferrite Entry
|
||||
- PMI Entry
|
||||
- Spool/NDT/Paint Release
|
||||
- Test Pack Base Status
|
||||
|
||||
Each screen opens a list view. Tap a record to edit it. Some screens use a bottom sheet form.
|
||||
|
||||
## Common Behaviors
|
||||
- **List + Tap to Edit:** All modules load a list of records. Tap a row to open the form.
|
||||
- **Filters:** Some screens include filters (status or ISO).
|
||||
- **Bulk Update (Weld Log):** Enable bulk mode, select multiple joints, and update once.
|
||||
- **Save Feedback:** Success and error feedback is shown via bottom snackbars.
|
||||
- **Photo Upload:** Modules like Test Pack and Spool Release use the docked Floating Action Button (`InspectionDockedFab`) for standardized photo uploads directly to `/api/inspection-history`.
|
||||
- **iOS UI:** iOS uses native Cupertino pickers and action sheets for date and dropdowns.
|
||||
|
||||
## 1) Weld Log Entry
|
||||
Use this screen to update welding-related fields from a single form.
|
||||
|
||||
### Fields
|
||||
Required:
|
||||
- Fit-up Date (`fit_up_date`)
|
||||
- Fit-up Report Number (`fit_up_report_no`)
|
||||
|
||||
Optional:
|
||||
- Welding Date (`welding_date`)
|
||||
- Welding Report Number (`welding_report_no`)
|
||||
- Welding Report Date (`welding_report_date`)
|
||||
- WPS No (`wps_no`)
|
||||
- WPS Approval Date (`wps_approval_date`)
|
||||
- Welder 1 (`welder_1`)
|
||||
- Welder 2 (`welder_2`)
|
||||
|
||||
NDT:
|
||||
- RT Result (`rt_result`)
|
||||
- RT Report (`rt_report`)
|
||||
- RT Test Date (`rt_test_date`)
|
||||
- UT Result (`ut_result`)
|
||||
- UT Report (`ut_report`)
|
||||
- UT Test Date (`ut_test_date`)
|
||||
- PT Result (`pt_result`)
|
||||
- PT Report (`pt_report`)
|
||||
- PT Test Date (`pt_test_date`)
|
||||
- MT Result (`mt_result`)
|
||||
- MT Report (`mt_report`)
|
||||
- MT Test Date (`mt_test_date`)
|
||||
- VT Result (`vt_result`)
|
||||
- VT Report (`vt_report`)
|
||||
- VT Test Date (`date_of_vt`)
|
||||
|
||||
### Validation
|
||||
- Fit-up Date is required and cannot be in the future.
|
||||
- Welding Date cannot be before Fit-up Date.
|
||||
- WPS Approval Date cannot be before Fit-up Date or Welding Date.
|
||||
- NDT test dates should be on or after welding dates.
|
||||
|
||||
### Save
|
||||
Tap Save to update the record in `weld_logs`.
|
||||
|
||||
### Bulk Update
|
||||
Use the bulk icon to select multiple joints, then tap **Update Selected**.
|
||||
|
||||
## 2) Punch Update
|
||||
Use this screen to close or update punch items.
|
||||
|
||||
### Fields
|
||||
- Status (`status`)
|
||||
- Cleared By Name (`items_cleared_by_name`)
|
||||
- Cleared Date (`items_cleared_by_close_date`)
|
||||
|
||||
### Save
|
||||
Tap Save to update the record in `punch_lists`.
|
||||
|
||||
## 3) Repair Status Entry
|
||||
Use this screen to track repair progress.
|
||||
|
||||
### Fields
|
||||
- Repair Status (`repair_status`)
|
||||
- Repair Qty (`repair_qty`)
|
||||
- Repair Completed (`repair_completed`)
|
||||
- Repair Remaining (`repair_remaining`)
|
||||
- Repair Date (`repair_date`)
|
||||
|
||||
### Save
|
||||
Tap Save to update the record in `repair_logs`.
|
||||
|
||||
## 4) NDT Request
|
||||
Use this screen to update joint-based NDT results.
|
||||
|
||||
### Fields
|
||||
- RT Result (`rt_result`)
|
||||
- UT Result (`ut_result`)
|
||||
- PT Result (`pt_result`)
|
||||
- MT Result (`mt_result`)
|
||||
- VT Result (`vt_result`)
|
||||
|
||||
### Save
|
||||
Tap Save to update the record in `weld_logs`.
|
||||
|
||||
## 5) RFI Create
|
||||
Use this screen to create a new RFI record.
|
||||
|
||||
### Fields
|
||||
- Project No (`project_no`)
|
||||
- Discipline (`discipline`)
|
||||
- RFI No (`rfi_no`)
|
||||
- Inspection Date (`inspection_date`)
|
||||
|
||||
### Save
|
||||
Tap Create to add a record in `r_f_i_s`.
|
||||
|
||||
## 6) RFI Update
|
||||
Use this screen to update existing RFIs.
|
||||
|
||||
### Fields
|
||||
- Status (`status`)
|
||||
- Result Date (`result_date`)
|
||||
|
||||
### Save
|
||||
Tap Save to update the record in `r_f_i_s`.
|
||||
|
||||
## 7) Ferrite Entry
|
||||
Use this screen for ferrite test updates.
|
||||
|
||||
### Fields
|
||||
- Ferrite Request Date (`ferrite_request_date`)
|
||||
- Tester Name (`tester_name`)
|
||||
- Ferrite Result (`result_ferrite`)
|
||||
|
||||
### Save
|
||||
Tap Save to update the record in `ferrits`.
|
||||
|
||||
## 8) PMI Entry
|
||||
Use this screen for PMI test updates.
|
||||
|
||||
### Fields
|
||||
- PMI Request Date (`pmi_request_date`)
|
||||
- Tester Name (`tester_name`)
|
||||
- PMI Result (`pmi_result`)
|
||||
|
||||
### Save
|
||||
Tap Save to update the record in `p_m_i_tests`.
|
||||
|
||||
## 9) Spool/NDT/Paint Release
|
||||
Use this unified screen to manage spool area, NDT, and paint releases from a single view.
|
||||
|
||||
### Process
|
||||
- Instead of finding separate menus for each release step, select the target record.
|
||||
- Tapping a record row directly edits the specific release stage data via bottom sheets.
|
||||
- Manage Spool, Paint, and Area Release states respectively.
|
||||
|
||||
### Save
|
||||
Tap Save inside the respective step's modal bottom sheet.
|
||||
|
||||
## Notes
|
||||
- If you do not see changes, fully restart the mobile app.
|
||||
- Some fields are optional and can be left empty.
|
||||
- If permissions block access, contact your admin to enable the module.
|
||||
|
||||
## Backend Endpoints Used
|
||||
- `POST /api/weld_logs/read`, `POST /api/weld_logs/update`, `POST /api/weld_logs/summary` (totalCount + SUM(nps_1) for footer)
|
||||
- `POST /api/punch_lists/read` and `POST /api/punch_lists/update`
|
||||
- `POST /api/repair_logs/read` and `POST /api/repair_logs/update`
|
||||
- `POST /api/r_f_i_s/read`, `POST /api/r_f_i_s/create`, `POST /api/r_f_i_s/update`
|
||||
- `POST /api/ferrits/read` and `POST /api/ferrits/update`
|
||||
- `POST /api/p_m_i_tests/read` and `POST /api/p_m_i_tests/update`
|
||||
- `POST /api/spools/read` and `POST /api/spools/update`
|
||||
- `POST /api/construction_paint_logs/read` and `POST /api/construction_paint_logs/update`
|
||||
- `GET /api/inspection-history/list` and `POST /api/inspection-history/upload`
|
||||
@@ -1,56 +0,0 @@
|
||||
# Mobile NDT Request – Feature Guide
|
||||
|
||||
## Overview
|
||||
|
||||
The **NDT Request** screen in the mobile app lets users enter or update NDT request information (request dates, NDT company) for weld log joints. Data is saved via the Dynamic Resource API to the `weld_logs` table.
|
||||
|
||||
## Where to Find It
|
||||
|
||||
- **Mobile app:** Sidebar → **NDT Request** (under NDT / ndt-entry module).
|
||||
- The screen lists weld logs; you can filter by Line, ISO, Spool, Joint, etc., then open a row to edit NDT fields.
|
||||
|
||||
## What You Can Do
|
||||
|
||||
- Set **request date** per NDT type: VT, RT, UT, PT, MT, PMI, PWHT, HT, Ferrite.
|
||||
- Select **NDT Company** (subcontractors with job_description = NDT).
|
||||
- Save changes; the app sends only the modified fields to the backend.
|
||||
|
||||
## API Used
|
||||
|
||||
All read and save operations use the **Dynamic Resource** API:
|
||||
|
||||
| Action | Endpoint | Description |
|
||||
|--------|----------|-------------|
|
||||
| List weld logs | `POST /api/weld_logs/read` | Filter, sort, paginate; columns requested by the app. |
|
||||
| Save (update) | `POST /api/weld_logs/update` | Body: `id`, `values` (key-value pairs for changed fields). |
|
||||
|
||||
So for save we use **`/api/weld_logs/update`**, not a separate “save” endpoint. The backend handler is `DynamicResourceController::handle` with `table = weld_logs`, `action = update`.
|
||||
|
||||
## Backend Validation Rule
|
||||
|
||||
When saving from the mobile app (or any client using the API), the backend applies this rule for **weld_logs**:
|
||||
|
||||
- **New request not allowed** if:
|
||||
- The joint has **welding_date** set, or
|
||||
- The joint has **any** `*_request_no` already set (e.g. VT, RT, UT, PT, MT, PMI, PWHT, HT, Ferrite).
|
||||
- **Allowed:** Updating an existing request (e.g. changing request date when that NDT type already has a request_no), or adding a first request when the joint has no welding_date and no request numbers.
|
||||
|
||||
If the rule is violated, the API returns **422** with a message like:
|
||||
*"New request entry is not allowed for this joint (welding date exists or request already exists). Only changes to existing requests are allowed."*
|
||||
|
||||
## Request Number (request_no)
|
||||
|
||||
- **request_no** (e.g. `pt_request_no`, `vt_request_no`) is generated by the **SaveTrigger** system (e.g. `RequestDateOperationsTrigger`).
|
||||
- On the **web** (Admin panel), it is triggered after save via `ExecuteSaveTriggerJob` from `AdminController::saveJson`.
|
||||
- On the **API** path (`/api/weld_logs/update`), the SaveTrigger is not run in the current implementation, so **request_no may not be auto-filled** when saving from the mobile app. If request numbers are required for API updates, the backend may need to run the same trigger logic (or an equivalent) after API update.
|
||||
|
||||
## Testing
|
||||
|
||||
- Use weld log rows that have **no** `welding_date` and **no** `*_request_no` to test “first request” (e.g. PT Request Date). See **ndt-request-pt-test-data.md** for eligible test IDs and steps.
|
||||
- For rows with existing request numbers, you can test updating request dates or NDT company; the validation allows updates to existing requests.
|
||||
|
||||
## Related Docs
|
||||
|
||||
- **ndt-request-pt-test-data.md** – Test data and steps for PT request date.
|
||||
- **dynamic-api-and-scribe-guide.md** – Dynamic API overview.
|
||||
- **save-trigger-system-guide.md** – SaveTrigger and request_no generation.
|
||||
@@ -1,116 +0,0 @@
|
||||
# Mobile Project Structure / Mobil Proje Yapısı
|
||||
|
||||
Bu doküman, Stellar mobil uygulamasının teknik mimarisini, klasör yapısını ve kullanılan teknolojileri hem Türkçe hem de İngilizce olarak açıklar.
|
||||
This document explains the technical architecture, folder structure, and technologies used in the Stellar mobile application in both Turkish and English.
|
||||
|
||||
---
|
||||
|
||||
## 1. Technology Stack / Teknoloji Yığını
|
||||
|
||||
- **Framework:** Flutter (Darta)
|
||||
- **State Management:** Riverpod (with Code Generation)
|
||||
- **Networking:** Dio
|
||||
- **Dependency Injection:** GetIt & Injectable
|
||||
- **UI Components:** Syncfusion DataGrid, Material Design
|
||||
- **Local Storage:** Flutter Secure Storage, Shared Preferences
|
||||
|
||||
---
|
||||
|
||||
## 2. Project Hierarchy / Proje Hiyerarşisi
|
||||
|
||||
```text
|
||||
lib/
|
||||
├── core/ # Core functionalities (API, DI, Config, Services) / Çekirdek işlevler
|
||||
│ ├── api/ # API Client (Dio) and interceptors / API İstemcisi ve interceptorlar
|
||||
│ ├── config/ # App configuration / Uygulama yapılandırması
|
||||
│ ├── constants/ # App-wide constants / Uygulama genelindeki sabitler
|
||||
│ ├── di/ # Dependency Injection setup / Bağımlılık Enjeksiyonu kurulumu
|
||||
│ └── services/ # Global services (Storage, etc.) / Global servisler
|
||||
├── common/ # Shared entities, widgets, and utilities / Ortak öğeler, widgetlar ve araçlar
|
||||
├── features/ # Feature-based modules / Özellik bazlı modüller
|
||||
│ ├── auth/ # Authentication feature / Kimlik doğrulama özelliği
|
||||
│ ├── data/ # General data viewing features / Genel veri görüntüleme özellikleri
|
||||
│ ├── field_entry/ # Field data entry modules / Saha veri giriş modülleri
|
||||
│ └── ... # Other features (rfi, ndt, fitup, etc.) / Diğer özellikler
|
||||
└── main.dart # App entry point / Uygulama giriş noktası
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3. Feature Architecture (Clean Architecture) / Özellik Mimarisi
|
||||
|
||||
Her özellik, **Clean Architecture** prensiplerine göre üç ana katmana ayrılmıştır:
|
||||
Each feature is divided into three main layers based on **Clean Architecture** principles:
|
||||
|
||||
### A. Data Layer / Veri Katmanı
|
||||
- **DataSources:** Raw API calls using Dio. / Dio kullanarak ham API çağrıları.
|
||||
- **DTOs (Models):** JSON serialization and data transfer objects. / JSON serileştirme ve veri transfer nesneleri.
|
||||
- **Repositories (Impl):** Concrete implementation of data logic. / Veri mantığının somut uygulaması.
|
||||
|
||||
### B. Domain Layer / Alan Katmanı
|
||||
- **Entities:** Pure business logic objects. / Saf iş mantığı nesneleri.
|
||||
- **Repositories (Interface):** Abstract definitions of data operations. / Veri operasyonlarının soyut tanımları.
|
||||
|
||||
### C. Presentation Layer / Sunum Katmanı
|
||||
- **Screens/Pages:** UI widgets. / Kullanıcı arayüzü bileşenleri.
|
||||
- **Providers:** Riverpod providers for state management. / Durum yönetimi için Riverpod sağlayıcıları.
|
||||
- **Widgets:** Feature-specific reusable UI components. / Özelliğe özel tekrar kullanılabilir bileşenler.
|
||||
|
||||
---
|
||||
|
||||
## 4. UI Components & Widgets / Arayüz Bileşenleri ve Widgetlar
|
||||
|
||||
### A. Navigation & Menu / Navigasyon ve Menü
|
||||
- **SidebarMenu:** `lib/features/data/presentation/widgets/sidebar_menu.dart`
|
||||
- Bu bileşen uygulamanın ana **Drawer** menüsüdür. / This is the main **Drawer** menu.
|
||||
- Modülleri aramak için bir arama çubuğu ve kullanıcı bilgilerini gösteren bir başlık içerir. / Includes a search bar for modules and a header with user info.
|
||||
- Modül sluglarına göre ilgili ekranlara yönlendirme yapar. / Routes to specific screens based on module slugs.
|
||||
|
||||
### B. Filtering System / Filtreleme Sistemi
|
||||
- **ModuleDataScreen Filters:** `lib/features/data/presentation/screens/module_data_screen.dart`
|
||||
- **_buildFilterHeader:** Listenin üstünde bulunan, aktif filtreleri ve "Sort/Filter" butonlarını içeren kısımdır. / The header above the list containing active filters and "Sort/Filter" buttons.
|
||||
- **_FilterSheet:** Çoklu kriterlere göre filtreleme yapılmasını sağlayan bottom sheet bileşenidir. / A bottom sheet component for multi-criteria filtering.
|
||||
- Filtreler JSON formatında backend'e gönderilir. / Filters are sent to the backend in JSON format.
|
||||
|
||||
### C. Actions & Inspections / Aksiyonlar ve Muayeneler
|
||||
- **InspectionDockedFab:** `lib/features/data/presentation/widgets/inspection_fab.dart`
|
||||
- Veri listesi (`ModuleDataScreen`) ve detay sayfalarında bulunan ana aksiyon butonudur. / The main action button in `ModuleDataScreen` and detail sheets.
|
||||
- Fotoğraf yükleme ve yorum ekleme işlevlerini yönetir. / Manages photo upload and comment addition.
|
||||
- **InspectionHistorySheet:**
|
||||
- `lib/features/data/presentation/widgets/inspection_history_sheet.dart`
|
||||
- Seçili kayda ait muayene fotoğraflarını ve geçmişini listeler. / Lists inspection photos and history for the selected record.
|
||||
|
||||
### D. Data Display / Veri Gösterimi
|
||||
- **ModuleDataScreen:** Genel veri listeleme ekranıdır. Sayfalama (Infinite Scroll) ve PDF görüntüleme desteği sunar. / Generic data listing screen with infinite scroll and PDF viewing support.
|
||||
- **_buildListItem:** Her bir veri satırını (Card) özelleştirilmiş icon ve badge'lerle oluşturur. / Builds each record card with customized icons and badges.
|
||||
|
||||
---
|
||||
|
||||
## 5. State Management / Durum Yönetimi
|
||||
|
||||
The project uses **Riverpod** with code generation (`@riverpod` annotation).
|
||||
Projede kod üretimi (`@riverpod` anotasyonu) ile **Riverpod** kullanılmaktadır.
|
||||
|
||||
- **Sync State:** Simple state variables. / Basit durum değişkenleri.
|
||||
- **Async State:** `FutureProvider` or `Notifier` for API data. / API verileri için `FutureProvider` veya `Notifier`.
|
||||
|
||||
---
|
||||
|
||||
## 5. API Handling / API Yönetimi
|
||||
|
||||
- **ApiClient:** Located in `lib/core/api/`, it handles base URLs, headers, and token injection.
|
||||
- **ApiClient:** `lib/core/api/` altında bulunur, base URL, headerlar ve token enjeksiyonunu yönetir.
|
||||
- **Interceptors:** Automatically adds Bearer tokens to requests from `StorageService`.
|
||||
- **Interceptorlar:** `StorageService` üzerinden gelen Bearer tokenları otomatik olarak isteklere ekler.
|
||||
|
||||
---
|
||||
|
||||
## 6. Dependency Injection / Bağımlılık Enjeksiyonu
|
||||
|
||||
We use **GetIt** combined with **Injectable**.
|
||||
**GetIt** ve **Injectable** kombinasyonunu kullanıyoruz.
|
||||
|
||||
- annotate classes with `@injectable` or `@singleton`.
|
||||
- Sınıfları `@injectable` veya `@singleton` ile işaretleyin.
|
||||
- Run `build_runner` to generate injection code.
|
||||
- Enjeksiyon kodunu oluşturmak için `build_runner` çalıştırın.
|
||||
@@ -1,77 +0,0 @@
|
||||
# MT Log User Guide
|
||||
|
||||
## What is the MT Log Module?
|
||||
|
||||
The MT Log module tracks and documents Magnetic Particle Testing (MT) activities and results. This module helps ensure proper MT procedures, monitor testing quality, and maintain quality control records for various project components.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access MT Log:
|
||||
1. Login to the system
|
||||
2. Click on **NDT** in the main menu
|
||||
3. Select **MT Log** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **MT Testing Logging**: Record magnetic particle testing activities and results
|
||||
- **Quality Control**: Monitor MT testing compliance and standards
|
||||
- **Data Analysis**: Analyze MT testing trends and patterns
|
||||
- **Report Generation**: Generate MT testing reports
|
||||
|
||||
### Secondary Functions
|
||||
- **Equipment Management**: Track MT equipment calibration and maintenance
|
||||
- **Operator Management**: Manage qualified MT testing operators
|
||||
- **Documentation**: Maintain MT testing records and procedures
|
||||
- **Alert System**: Alert when MT results indicate defects
|
||||
|
||||
## How to Use
|
||||
|
||||
### Recording MT Tests
|
||||
1. Click **"New MT Test"** button
|
||||
2. Select the component or material to test
|
||||
3. Choose MT method and technique
|
||||
4. Enter test conditions and parameters
|
||||
5. Record test results and findings
|
||||
6. Add test observations and comments
|
||||
7. Save test record
|
||||
|
||||
### Quality Control Process
|
||||
1. Review MT testing specifications
|
||||
2. Verify equipment calibration status
|
||||
3. Check operator qualifications
|
||||
4. Monitor testing accuracy and repeatability
|
||||
5. Document any deviations or issues
|
||||
6. Take corrective action if needed
|
||||
|
||||
### Testing Categories
|
||||
- **Weld Joints**: MT testing of welded joints
|
||||
- **Base Materials**: MT testing of base materials
|
||||
- **Components**: MT testing of various components
|
||||
- **Special Applications**: Critical MT testing requirements
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Always calibrate equipment before testing
|
||||
- ✅ Follow proper MT testing procedures and standards
|
||||
- ✅ Document test conditions accurately
|
||||
- ✅ Verify operator qualifications
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Check equipment calibration regularly
|
||||
- ✅ Verify testing accuracy and repeatability
|
||||
- ✅ Monitor MT testing trends and patterns
|
||||
- ✅ Document any testing issues or deviations
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Testing errors**: Check equipment calibration and procedure
|
||||
2. **False indications**: Review testing technique and conditions
|
||||
3. **Equipment malfunction**: Contact equipment maintenance
|
||||
|
||||
### Getting Help
|
||||
- Contact the NDT department for technical support
|
||||
- Consult MT testing procedures and standards
|
||||
- Check equipment calibration records
|
||||
@@ -1,76 +0,0 @@
|
||||
# MTO User Guide
|
||||
|
||||
## What is the MTO Module?
|
||||
|
||||
The MTO (Material Take-Off) module manages material take-off processes and calculations. This module helps track material requirements, manage take-off calculations, and ensure proper material planning and documentation.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access MTO:
|
||||
1. Login to the system
|
||||
2. Click on **Manufacturing** in the main menu
|
||||
3. Select **MTO** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **MTO Management**: Manage material take-off processes
|
||||
- **Calculation Tracking**: Track take-off calculations
|
||||
- **Material Planning**: Plan material requirements
|
||||
- **Documentation**: Maintain MTO documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate MTO reports
|
||||
- **Data Analysis**: Analyze MTO data and trends
|
||||
- **Export Options**: Export MTO data in various formats
|
||||
- **Validation Tools**: Validate MTO calculations
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing MTO Processes
|
||||
1. Click **"Manage MTO"** button
|
||||
2. Select MTO for management
|
||||
3. Review take-off calculations
|
||||
4. Update MTO information
|
||||
5. Track material requirements
|
||||
6. Generate MTO reports
|
||||
7. Monitor planning status
|
||||
|
||||
### MTO Management
|
||||
1. Review MTO calculations
|
||||
2. Update material requirements
|
||||
3. Track planning status
|
||||
4. Monitor material needs
|
||||
5. Generate MTO reports
|
||||
|
||||
### MTO Categories
|
||||
- **Material Calculations**: Material requirement calculations
|
||||
- **Take-off Processes**: Take-off calculation processes
|
||||
- **Planning Documents**: Material planning documents
|
||||
- **Validation Reports**: MTO validation reports
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Keep MTO calculations accurate and current
|
||||
- ✅ Monitor material requirements regularly
|
||||
- ✅ Maintain proper documentation
|
||||
- ✅ Validate calculations thoroughly
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify MTO calculation accuracy
|
||||
- ✅ Ensure proper material planning
|
||||
- ✅ Monitor MTO management effectiveness
|
||||
- ✅ Regular review of MTO processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Calculation errors**: Check calculation formulas and parameters
|
||||
2. **Material shortages**: Review material requirements and availability
|
||||
3. **Planning issues**: Verify planning requirements and constraints
|
||||
|
||||
### Getting Help
|
||||
- Contact the Manufacturing department for technical support
|
||||
- Consult MTO procedures and guidelines
|
||||
- Check MTO calculations and material planning status
|
||||
@@ -1,76 +0,0 @@
|
||||
# NAKS Consumables User Guide
|
||||
|
||||
## What is the NAKS Consumables Module?
|
||||
|
||||
The NAKS Consumables module manages NAKS-approved welding consumables and materials. This module helps track approved consumables, manage consumable inventory, and ensure proper NAKS consumable compliance.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NAKS Consumables:
|
||||
1. Login to the system
|
||||
2. Click on **Welding** in the main menu
|
||||
3. Select **NAKS Consumables** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Consumable Management**: Manage NAKS-approved consumables
|
||||
- **Inventory Control**: Control consumable inventory
|
||||
- **Approval Tracking**: Track consumable approvals
|
||||
- **Documentation**: Maintain consumable documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate consumable reports
|
||||
- **Supplier Management**: Manage consumable suppliers
|
||||
- **Quality Control**: Monitor consumable quality
|
||||
- **Compliance Monitoring**: Monitor consumable compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing NAKS Consumables
|
||||
1. Click **"Manage Consumables"** button
|
||||
2. Select consumable for management
|
||||
3. Review consumable specifications
|
||||
4. Update inventory information
|
||||
5. Track approval status
|
||||
6. Monitor quality control
|
||||
7. Generate consumable reports
|
||||
|
||||
### Consumable Management
|
||||
1. Review NAKS-approved consumables
|
||||
2. Update inventory levels
|
||||
3. Track approval status
|
||||
4. Monitor quality control
|
||||
5. Generate consumable reports
|
||||
|
||||
### Consumable Categories
|
||||
- **Electrodes**: Welding electrodes
|
||||
- **Wires**: Welding wires
|
||||
- **Gases**: Shielding gases
|
||||
- **Fluxes**: Welding fluxes
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Use only NAKS-approved consumables
|
||||
- ✅ Monitor inventory levels regularly
|
||||
- ✅ Track consumable quality
|
||||
- ✅ Maintain proper documentation
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify consumable approval status
|
||||
- ✅ Monitor consumable quality
|
||||
- ✅ Track inventory accuracy
|
||||
- ✅ Regular review of consumable processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Consumable not approved**: Check NAKS approval status
|
||||
2. **Inventory errors**: Verify inventory levels and calculations
|
||||
3. **Quality issues**: Review quality control procedures
|
||||
|
||||
### Getting Help
|
||||
- Contact the Welding department for technical support
|
||||
- Consult NAKS consumables procedures and guidelines
|
||||
- Check consumable approval and inventory status
|
||||
@@ -1,443 +0,0 @@
|
||||
# NAKS Multi-Module Cross-Site Synchronization
|
||||
|
||||
[English](#english) | [Türkçe](#türkçe)
|
||||
|
||||
---
|
||||
|
||||
## English
|
||||
|
||||
### Overview
|
||||
|
||||
The NAKS Sync system enables automatic synchronization of all NAKS-related data across multiple project sites. Each site runs this sync process to pull data from other sites, ensuring all sites have the same NAKS data.
|
||||
|
||||
### Supported Modules
|
||||
|
||||
| Module Key | Name | Table | Unique Keys | PDF Folder |
|
||||
|------------|------|-------|-------------|------------|
|
||||
| `technology` | NAKS Technology | `naks_certificates` | `short_number` + `certificate_no` | `0000_Naks Technology` |
|
||||
| `welder` | NAKS Welder | `naks_welders` | `naks_certificate_no` + `welder_id` | `0003_Naks Welder` |
|
||||
| `consumables` | NAKS Consumables | `naks_consumables` | `naks_certificate_no` + `batch_number` | `0002_Naks Consumables` |
|
||||
| `expert` | NAKS Expert | `register_of_experts` | `certificate_no` | `0004_Naks Expert` |
|
||||
| `equipment` | NAKS Equipment | `welding_equipment` | `attestation` | `0001_Naks Equipment` |
|
||||
|
||||
### Architecture
|
||||
|
||||
```
|
||||
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
||||
│ Site 101 │ │ Site 102 │ │ Site 104 │
|
||||
│ (Cherepovets) │ │ (Viksa OMK) │ │ (Novokuznetsk) │
|
||||
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
|
||||
│ │ │
|
||||
└───────────────────────┼───────────────────────┘
|
||||
│
|
||||
┌────────────▼────────────┐
|
||||
│ API Communication │
|
||||
│ │
|
||||
│ For Each Module: │
|
||||
│ • naks_certificates │
|
||||
│ • naks_welders │
|
||||
│ • naks_consumables │
|
||||
│ • register_of_experts │
|
||||
│ • welding_equipment │
|
||||
└─────────────────────────┘
|
||||
```
|
||||
|
||||
### Key Features
|
||||
|
||||
- **Multi-Module Support**: Sync all 5 NAKS modules in one command
|
||||
- **Selective Sync**: Choose specific module(s) to sync
|
||||
- **Incremental Sync**: Only syncs new/updated records since last sync
|
||||
- **Conflict Resolution**: Uses `updated_at` timestamp - newer record wins
|
||||
- **PDF Download**: Automatically downloads certificate PDF files
|
||||
- **Multi-site Support**: Works with all registered project sites
|
||||
- **Dry Run Mode**: Test sync without making changes
|
||||
|
||||
### Installation
|
||||
|
||||
#### 1. Environment Configuration
|
||||
|
||||
Add the following to your `.env` file on each site:
|
||||
|
||||
```env
|
||||
# Cross-Site NAKS Sync
|
||||
SYNC_ADMIN_EMAIL=sync@stellarcons.com
|
||||
SYNC_ADMIN_PASSWORD=YourSecurePassword
|
||||
```
|
||||
|
||||
> **Important**: The same admin credentials must exist on all project sites.
|
||||
|
||||
#### 2. Database Migration
|
||||
|
||||
Run the migration to create the sync state tracking table:
|
||||
|
||||
```bash
|
||||
php artisan migrate
|
||||
```
|
||||
|
||||
This creates the `sync_states` table that tracks sync progress for each module and source.
|
||||
|
||||
### Usage
|
||||
|
||||
#### Command Options
|
||||
|
||||
```bash
|
||||
# Sync ALL modules from all projects
|
||||
php artisan naks:sync
|
||||
|
||||
# Sync specific module only
|
||||
php artisan naks:sync --module=technology
|
||||
php artisan naks:sync --module=welder
|
||||
php artisan naks:sync --module=consumables
|
||||
php artisan naks:sync --module=expert
|
||||
php artisan naks:sync --module=equipment
|
||||
|
||||
# Sync specific project only
|
||||
php artisan naks:sync --project=101
|
||||
php artisan naks:sync --project=Cherepovets
|
||||
|
||||
# Combine options
|
||||
php artisan naks:sync --module=welder --project=101
|
||||
|
||||
# Test mode (no changes)
|
||||
php artisan naks:sync --dry-run
|
||||
|
||||
# Force sync all records (ignore last sync ID)
|
||||
php artisan naks:sync --force
|
||||
|
||||
# Show sync status
|
||||
php artisan naks:sync --status
|
||||
php artisan naks:sync --status --module=welder
|
||||
|
||||
# Reset sync state
|
||||
php artisan naks:sync --reset
|
||||
php artisan naks:sync --reset --module=welder
|
||||
php artisan naks:sync --reset --project=101
|
||||
```
|
||||
|
||||
#### Example Output
|
||||
|
||||
```
|
||||
╔════════════════════════════════════════════════════════════╗
|
||||
║ NAKS Multi-Module Cross-Site Synchronization ║
|
||||
╚════════════════════════════════════════════════════════════╝
|
||||
|
||||
📦 Available Modules:
|
||||
+-------------+------------------+---------------------+----------------------------------+
|
||||
| Key | Name | Table | Unique Keys |
|
||||
+-------------+------------------+---------------------+----------------------------------+
|
||||
| technology | NAKS Technology | naks_certificates | short_number + certificate_no |
|
||||
| welder | NAKS Welder | naks_welders | naks_certificate_no + welder_id |
|
||||
| consumables | NAKS Consumables | naks_consumables | naks_certificate_no + batch_num |
|
||||
| expert | NAKS Expert | register_of_experts | certificate_no |
|
||||
| equipment | NAKS Equipment | welding_equipment | attestation |
|
||||
+-------------+------------------+---------------------+----------------------------------+
|
||||
|
||||
📋 Available Projects:
|
||||
+---------------------------+-----------------------------------+
|
||||
| Project Name | URL |
|
||||
+---------------------------+-----------------------------------+
|
||||
| 101-Cherepovets | https://101.qms.stellarcons.com |
|
||||
| 102 - VIKSA OMK | https://viksaqms.stellarcons.com |
|
||||
| 104 - Новокузнецк | https://104.qms.stellarcons.com |
|
||||
+---------------------------+-----------------------------------+
|
||||
|
||||
🔄 Starting synchronization...
|
||||
|
||||
════════════════════════════════════════════════════════════
|
||||
SYNC RESULTS
|
||||
════════════════════════════════════════════════════════════
|
||||
|
||||
+---------------------+-------+
|
||||
| Metric | Value |
|
||||
+---------------------+-------+
|
||||
| Total Projects | 5 |
|
||||
| Successful Projects | 5 |
|
||||
| Failed Projects | 0 |
|
||||
| Duration | 120s |
|
||||
+---------------------+-------+
|
||||
|
||||
📦 Module Results:
|
||||
+------------------+--------+----------+---------+---------+------+
|
||||
| Module | Synced | Inserted | Updated | Skipped | PDFs |
|
||||
+------------------+--------+----------+---------+---------+------+
|
||||
| NAKS Technology | 150 | 45 | 30 | 75 | 12 |
|
||||
| NAKS Welder | 200 | 80 | 40 | 80 | 25 |
|
||||
| NAKS Consumables | 100 | 30 | 20 | 50 | 5 |
|
||||
| NAKS Expert | 50 | 15 | 10 | 25 | 8 |
|
||||
| NAKS Equipment | 75 | 25 | 15 | 35 | 10 |
|
||||
| ───────── | ───── | ──────── | ─────── | ─────── | ──── |
|
||||
| TOTAL | 575 | 195 | 115 | 265 | 60 |
|
||||
+------------------+--------+----------+---------+---------+------+
|
||||
|
||||
✅ Synchronization completed successfully!
|
||||
```
|
||||
|
||||
### Cron Schedule
|
||||
|
||||
The sync runs automatically every day at 02:00 AM. Configuration in `app/Console/Kernel.php`:
|
||||
|
||||
```php
|
||||
$schedule->command('naks:sync --module=all')
|
||||
->daily()
|
||||
->at('02:00')
|
||||
->withoutOverlapping(120)
|
||||
->appendOutputTo(storage_path('logs/naks-sync.log'));
|
||||
```
|
||||
|
||||
### Sync Logic
|
||||
|
||||
1. **Get Project List**: Fetches available projects from `/api/project-app-urls`
|
||||
2. **Authenticate**: Logs in to each remote site once to get Bearer token
|
||||
3. **For Each Module**:
|
||||
- Get last synced ID from `sync_states` table
|
||||
- Fetch records with ID > last_synced_id
|
||||
- For each record:
|
||||
- If not exists locally (by unique keys) → INSERT
|
||||
- If exists and remote is newer → UPDATE
|
||||
- If exists and local is newer → SKIP
|
||||
- Download PDF if available
|
||||
- Update sync state
|
||||
|
||||
### Module Details
|
||||
|
||||
#### NAKS Technology (`technology`)
|
||||
- **Table**: `naks_certificates`
|
||||
- **Unique Key**: `short_number` + `certificate_no`
|
||||
- **Example**: АЦСТ-149 + 00036
|
||||
- **PDF Path**: `storage/documents/003_Welding_Database/0000_Naks Technology/`
|
||||
|
||||
#### NAKS Welder (`welder`)
|
||||
- **Table**: `naks_welders`
|
||||
- **Unique Key**: `naks_certificate_no` + `welder_id`
|
||||
- **PDF Path**: `storage/documents/003_Welding_Database/0003_Naks Welder/`
|
||||
|
||||
#### NAKS Consumables (`consumables`)
|
||||
- **Table**: `naks_consumables`
|
||||
- **Unique Key**: `naks_certificate_no` + `batch_number`
|
||||
- **PDF Path**: `storage/documents/003_Welding_Database/0002_Naks Consumables/`
|
||||
|
||||
#### NAKS Expert (`expert`)
|
||||
- **Table**: `register_of_experts`
|
||||
- **Unique Key**: `certificate_no`
|
||||
- **PDF Path**: `storage/documents/003_Welding_Database/0004_Naks Expert/`
|
||||
|
||||
#### NAKS Equipment (`equipment`)
|
||||
- **Table**: `welding_equipment`
|
||||
- **Unique Key**: `attestation`
|
||||
- **PDF Path**: `storage/documents/003_Welding_Database/0001_Naks Equipment/`
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
| Issue | Solution |
|
||||
|-------|----------|
|
||||
| Authentication failed | Check SYNC_ADMIN_EMAIL/PASSWORD in .env |
|
||||
| No projects found | Verify /api/project-app-urls endpoint |
|
||||
| PDFs not downloading | Check storage permissions |
|
||||
| Sync stuck | Run with `--reset` to clear state |
|
||||
| Module not syncing | Check if table exists and has data |
|
||||
|
||||
### Log Files
|
||||
|
||||
- **Cron Output**: `storage/logs/naks-sync.log`
|
||||
- **Application Log**: `storage/logs/laravel.log`
|
||||
|
||||
---
|
||||
|
||||
## Türkçe
|
||||
|
||||
### Genel Bakış
|
||||
|
||||
NAKS Sync sistemi, tüm NAKS ile ilgili verilerin birden fazla proje şantiyesi arasında otomatik senkronizasyonunu sağlar. Her şantiye bu sync işlemini çalıştırarak diğer şantiyelerden veri çeker ve tüm şantiyelerin aynı NAKS verisine sahip olmasını sağlar.
|
||||
|
||||
### Desteklenen Modüller
|
||||
|
||||
| Modül Key | İsim | Tablo | Benzersiz Anahtar | PDF Klasörü |
|
||||
|-----------|------|-------|-------------------|-------------|
|
||||
| `technology` | NAKS Teknoloji | `naks_certificates` | `short_number` + `certificate_no` | `0000_Naks Technology` |
|
||||
| `welder` | NAKS Kaynakçı | `naks_welders` | `naks_certificate_no` + `welder_id` | `0003_Naks Welder` |
|
||||
| `consumables` | NAKS Sarf Malzeme | `naks_consumables` | `naks_certificate_no` + `batch_number` | `0002_Naks Consumables` |
|
||||
| `expert` | NAKS Uzman | `register_of_experts` | `certificate_no` | `0004_Naks Expert` |
|
||||
| `equipment` | NAKS Ekipman | `welding_equipment` | `attestation` | `0001_Naks Equipment` |
|
||||
|
||||
### Mimari
|
||||
|
||||
```
|
||||
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
||||
│ Şantiye 101 │ │ Şantiye 102 │ │ Şantiye 104 │
|
||||
│ (Cherepovets) │ │ (Viksa OMK) │ │ (Novokuznetsk) │
|
||||
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
|
||||
│ │ │
|
||||
└───────────────────────┼───────────────────────┘
|
||||
│
|
||||
┌────────────▼────────────┐
|
||||
│ API İletişimi │
|
||||
│ │
|
||||
│ Her Modül İçin: │
|
||||
│ • naks_certificates │
|
||||
│ • naks_welders │
|
||||
│ • naks_consumables │
|
||||
│ • register_of_experts │
|
||||
│ • welding_equipment │
|
||||
└─────────────────────────┘
|
||||
```
|
||||
|
||||
### Temel Özellikler
|
||||
|
||||
- **Çoklu Modül Desteği**: Tek komutla 5 NAKS modülünü sync et
|
||||
- **Seçici Sync**: Belirli modül(ler)i sync et
|
||||
- **Artımlı Sync**: Sadece son sync'ten sonra eklenen/güncellenen kayıtları senkronize eder
|
||||
- **Çakışma Çözümü**: `updated_at` zaman damgası kullanır - yeni olan kazanır
|
||||
- **PDF İndirme**: Sertifika PDF dosyalarını otomatik indirir
|
||||
- **Çoklu Şantiye Desteği**: Tüm kayıtlı proje şantiyeleriyle çalışır
|
||||
- **Deneme Modu**: Değişiklik yapmadan sync'i test et
|
||||
|
||||
### Kurulum
|
||||
|
||||
#### 1. Ortam Yapılandırması
|
||||
|
||||
Her şantiyede `.env` dosyasına aşağıdakileri ekleyin:
|
||||
|
||||
```env
|
||||
# Şantiyeler Arası NAKS Sync
|
||||
SYNC_ADMIN_EMAIL=sync@stellarcons.com
|
||||
SYNC_ADMIN_PASSWORD=GuvenliSifreniz
|
||||
```
|
||||
|
||||
> **Önemli**: Aynı admin kimlik bilgileri tüm proje şantiyelerinde mevcut olmalıdır.
|
||||
|
||||
#### 2. Veritabanı Migrasyonu
|
||||
|
||||
Sync durum takip tablosunu oluşturmak için migrasyonu çalıştırın:
|
||||
|
||||
```bash
|
||||
php artisan migrate
|
||||
```
|
||||
|
||||
### Kullanım
|
||||
|
||||
#### Komut Seçenekleri
|
||||
|
||||
```bash
|
||||
# TÜM modülleri tüm projelerden sync et
|
||||
php artisan naks:sync
|
||||
|
||||
# Sadece belirli modülü sync et
|
||||
php artisan naks:sync --module=technology
|
||||
php artisan naks:sync --module=welder
|
||||
php artisan naks:sync --module=consumables
|
||||
php artisan naks:sync --module=expert
|
||||
php artisan naks:sync --module=equipment
|
||||
|
||||
# Sadece belirli projeyi sync et
|
||||
php artisan naks:sync --project=101
|
||||
php artisan naks:sync --project=Cherepovets
|
||||
|
||||
# Seçenekleri birleştir
|
||||
php artisan naks:sync --module=welder --project=101
|
||||
|
||||
# Test modu (değişiklik yapma)
|
||||
php artisan naks:sync --dry-run
|
||||
|
||||
# Tüm kayıtları zorla sync et
|
||||
php artisan naks:sync --force
|
||||
|
||||
# Sync durumunu göster
|
||||
php artisan naks:sync --status
|
||||
php artisan naks:sync --status --module=welder
|
||||
|
||||
# Sync durumunu sıfırla
|
||||
php artisan naks:sync --reset
|
||||
php artisan naks:sync --reset --module=welder
|
||||
```
|
||||
|
||||
### Cron Zamanlaması
|
||||
|
||||
Sync her gün sabah 02:00'de otomatik olarak çalışır. `app/Console/Kernel.php` içindeki yapılandırma:
|
||||
|
||||
```php
|
||||
$schedule->command('naks:sync --module=all')
|
||||
->daily()
|
||||
->at('02:00')
|
||||
->withoutOverlapping(120)
|
||||
->appendOutputTo(storage_path('logs/naks-sync.log'));
|
||||
```
|
||||
|
||||
### Sync Mantığı
|
||||
|
||||
1. **Proje Listesi Al**: `/api/project-app-urls`'den mevcut projeleri çeker
|
||||
2. **Kimlik Doğrula**: Bearer token almak için her uzak şantiyeye bir kez giriş yapar
|
||||
3. **Her Modül İçin**:
|
||||
- `sync_states` tablosundan son sync edilen ID'yi al
|
||||
- ID > last_synced_id olan kayıtları çek
|
||||
- Her kayıt için:
|
||||
- Yerel'de yoksa (benzersiz anahtarlara göre) → EKLE
|
||||
- Varsa ve uzaktaki daha yeniyse → GÜNCELLE
|
||||
- Varsa ve yereldeki daha yeniyse → ATLA
|
||||
- PDF varsa indir
|
||||
- Sync durumunu güncelle
|
||||
|
||||
### Modül Detayları
|
||||
|
||||
#### NAKS Teknoloji (`technology`)
|
||||
- **Tablo**: `naks_certificates`
|
||||
- **Benzersiz Anahtar**: `short_number` + `certificate_no`
|
||||
- **Örnek**: АЦСТ-149 + 00036
|
||||
- **PDF Yolu**: `storage/documents/003_Welding_Database/0000_Naks Technology/`
|
||||
|
||||
#### NAKS Kaynakçı (`welder`)
|
||||
- **Tablo**: `naks_welders`
|
||||
- **Benzersiz Anahtar**: `naks_certificate_no` + `welder_id`
|
||||
- **PDF Yolu**: `storage/documents/003_Welding_Database/0003_Naks Welder/`
|
||||
|
||||
#### NAKS Sarf Malzeme (`consumables`)
|
||||
- **Tablo**: `naks_consumables`
|
||||
- **Benzersiz Anahtar**: `naks_certificate_no` + `batch_number`
|
||||
- **PDF Yolu**: `storage/documents/003_Welding_Database/0002_Naks Consumables/`
|
||||
|
||||
#### NAKS Uzman (`expert`)
|
||||
- **Tablo**: `register_of_experts`
|
||||
- **Benzersiz Anahtar**: `certificate_no`
|
||||
- **PDF Yolu**: `storage/documents/003_Welding_Database/0004_Naks Expert/`
|
||||
|
||||
#### NAKS Ekipman (`equipment`)
|
||||
- **Tablo**: `welding_equipment`
|
||||
- **Benzersiz Anahtar**: `attestation`
|
||||
- **PDF Yolu**: `storage/documents/003_Welding_Database/0001_Naks Equipment/`
|
||||
|
||||
### Sorun Giderme
|
||||
|
||||
| Sorun | Çözüm |
|
||||
|-------|-------|
|
||||
| Kimlik doğrulama başarısız | .env'deki SYNC_ADMIN_EMAIL/PASSWORD'ü kontrol edin |
|
||||
| Proje bulunamadı | /api/project-app-urls endpoint'ini doğrulayın |
|
||||
| PDF'ler indirilmiyor | Storage izinlerini kontrol edin |
|
||||
| Sync takıldı | Durumu temizlemek için `--reset` ile çalıştırın |
|
||||
| Modül sync olmuyor | Tablonun var olduğunu ve veri içerdiğini kontrol edin |
|
||||
|
||||
### Log Dosyaları
|
||||
|
||||
- **Cron Çıktısı**: `storage/logs/naks-sync.log`
|
||||
- **Uygulama Logu**: `storage/logs/laravel.log`
|
||||
|
||||
---
|
||||
|
||||
## Files Reference
|
||||
|
||||
| File | Description |
|
||||
|------|-------------|
|
||||
| `app/Console/Commands/NaksSync.php` | Artisan command |
|
||||
| `app/Services/NaksSyncService.php` | Multi-module sync service |
|
||||
| `database/migrations/2025_01_07_000001_create_sync_states_table.php` | Migration |
|
||||
| `app/Console/Kernel.php` | Cron schedule configuration |
|
||||
|
||||
## API Endpoints Used
|
||||
|
||||
| Endpoint | Method | Description |
|
||||
|----------|--------|-------------|
|
||||
| `/api/login` | POST | Get Bearer token |
|
||||
| `/api/project-app-urls` | GET | Get project list |
|
||||
| `/api/{table}/read` | GET | Fetch records for each module |
|
||||
|
||||
---
|
||||
|
||||
*Last Updated: January 2025*
|
||||
@@ -1,76 +0,0 @@
|
||||
# NAKS Technology User Guide
|
||||
|
||||
## What is the NAKS Technology Module?
|
||||
|
||||
The NAKS Technology module manages NAKS (National Agency for Welding Control) technology standards and requirements. This module helps track NAKS technology compliance, manage welding technology standards, and ensure proper NAKS technology implementation.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NAKS Technology:
|
||||
1. Login to the system
|
||||
2. Click on **Welding** in the main menu
|
||||
3. Select **NAKS Technology** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Technology Management**: Manage NAKS technology standards
|
||||
- **Compliance Tracking**: Track NAKS technology compliance
|
||||
- **Standard Management**: Manage welding technology standards
|
||||
- **Documentation**: Maintain technology documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate technology reports
|
||||
- **Version Control**: Manage technology versions
|
||||
- **Training Integration**: Integrate with training materials
|
||||
- **Compliance Monitoring**: Monitor technology compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing NAKS Technology
|
||||
1. Click **"Manage Technology"** button
|
||||
2. Select technology standard for management
|
||||
3. Review technology requirements
|
||||
4. Update technology information
|
||||
5. Track compliance status
|
||||
6. Generate technology reports
|
||||
7. Monitor technology implementation
|
||||
|
||||
### Technology Management
|
||||
1. Review NAKS technology standards
|
||||
2. Update technology requirements
|
||||
3. Track compliance status
|
||||
4. Monitor implementation
|
||||
5. Generate technology reports
|
||||
|
||||
### Technology Categories
|
||||
- **Welding Technologies**: Various welding technology standards
|
||||
- **Process Standards**: Welding process standards
|
||||
- **Quality Standards**: Quality control standards
|
||||
- **Safety Standards**: Safety and compliance standards
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Keep technology standards current
|
||||
- ✅ Monitor compliance regularly
|
||||
- ✅ Update technology as needed
|
||||
- ✅ Ensure proper implementation
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify technology accuracy and completeness
|
||||
- ✅ Ensure proper compliance monitoring
|
||||
- ✅ Monitor technology effectiveness
|
||||
- ✅ Regular review of technology processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Technology not updating**: Check user permissions and system status
|
||||
2. **Compliance issues**: Review compliance requirements
|
||||
3. **Implementation problems**: Verify technology implementation
|
||||
|
||||
### Getting Help
|
||||
- Contact the Welding department for technical support
|
||||
- Consult NAKS technology procedures and guidelines
|
||||
- Check technology standards and compliance requirements
|
||||
@@ -1,76 +0,0 @@
|
||||
# Naks Welder User Guide
|
||||
|
||||
## What is the Naks Welder Module?
|
||||
|
||||
The Naks Welder module manages NAKS (National Agency for Welding Control) certified welders and their qualifications. This module helps track welder certifications, manage welder qualifications, and ensure proper NAKS welder compliance.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Naks Welder:
|
||||
1. Login to the system
|
||||
2. Click on **Welding** in the main menu
|
||||
3. Select **Naks Welder** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Welder Management**: Manage NAKS certified welders
|
||||
- **Certification Tracking**: Track welder certifications
|
||||
- **Qualification Management**: Manage welder qualifications
|
||||
- **Documentation**: Maintain welder documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate welder reports
|
||||
- **Search and Filter**: Search and filter welder data
|
||||
- **Export Options**: Export welder data in various formats
|
||||
- **Compliance Monitoring**: Monitor welder compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing Naks Welders
|
||||
1. Click **"Manage Welders"** button
|
||||
2. Select welder for management
|
||||
3. Review welder certifications
|
||||
4. Update welder information
|
||||
5. Track qualification status
|
||||
6. Generate welder reports
|
||||
7. Monitor compliance
|
||||
|
||||
### Welder Management
|
||||
1. Review welder certifications
|
||||
2. Update welder information
|
||||
3. Track qualification status
|
||||
4. Monitor compliance
|
||||
5. Generate welder reports
|
||||
|
||||
### Welder Categories
|
||||
- **Certified Welders**: NAKS certified welders
|
||||
- **Qualified Welders**: Qualified welders
|
||||
- **Trainee Welders**: Welder trainees
|
||||
- **Expired Certifications**: Expired certifications
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Keep welder data current and accurate
|
||||
- ✅ Monitor certification expiration dates
|
||||
- ✅ Maintain proper documentation
|
||||
- ✅ Ensure compliance with NAKS standards
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify welder certification accuracy
|
||||
- ✅ Ensure proper qualification tracking
|
||||
- ✅ Monitor welder management effectiveness
|
||||
- ✅ Regular review of welder processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Certification expired**: Check certification dates and renewal
|
||||
2. **Qualification errors**: Verify qualification requirements
|
||||
3. **Compliance issues**: Review NAKS compliance requirements
|
||||
|
||||
### Getting Help
|
||||
- Contact the Welding department for technical support
|
||||
- Consult NAKS welder procedures and guidelines
|
||||
- Check welder certification and qualification status
|
||||
@@ -1,76 +0,0 @@
|
||||
# NAKS Welding Equipments User Guide
|
||||
|
||||
## What is the NAKS Welding Equipments Module?
|
||||
|
||||
The NAKS Welding Equipments module manages NAKS-approved welding equipment and machinery. This module helps track approved equipment, manage equipment maintenance, and ensure proper NAKS equipment compliance.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NAKS Welding Equipments:
|
||||
1. Login to the system
|
||||
2. Click on **Welding** in the main menu
|
||||
3. Select **NAKS Welding Equipments** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Equipment Management**: Manage NAKS-approved welding equipment
|
||||
- **Maintenance Tracking**: Track equipment maintenance
|
||||
- **Approval Management**: Manage equipment approvals
|
||||
- **Documentation**: Maintain equipment documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate equipment reports
|
||||
- **Calibration Tracking**: Track equipment calibration
|
||||
- **Quality Control**: Monitor equipment performance
|
||||
- **Compliance Monitoring**: Monitor equipment compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing NAKS Equipment
|
||||
1. Click **"Manage Equipment"** button
|
||||
2. Select equipment for management
|
||||
3. Review equipment specifications
|
||||
4. Update maintenance information
|
||||
5. Track approval status
|
||||
6. Monitor performance
|
||||
7. Generate equipment reports
|
||||
|
||||
### Equipment Management
|
||||
1. Review NAKS-approved equipment
|
||||
2. Update maintenance schedules
|
||||
3. Track approval status
|
||||
4. Monitor equipment performance
|
||||
5. Generate equipment reports
|
||||
|
||||
### Equipment Categories
|
||||
- **Welding Machines**: Welding power sources
|
||||
- **Torches**: Welding torches and guns
|
||||
- **Accessories**: Welding accessories
|
||||
- **Testing Equipment**: Testing and calibration equipment
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Use only NAKS-approved equipment
|
||||
- ✅ Maintain equipment regularly
|
||||
- ✅ Track calibration schedules
|
||||
- ✅ Monitor equipment performance
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify equipment approval status
|
||||
- ✅ Monitor equipment performance
|
||||
- ✅ Track maintenance schedules
|
||||
- ✅ Regular review of equipment processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Equipment not approved**: Check NAKS approval status
|
||||
2. **Maintenance overdue**: Review maintenance schedules
|
||||
3. **Performance issues**: Check equipment calibration
|
||||
|
||||
### Getting Help
|
||||
- Contact the Welding department for technical support
|
||||
- Consult NAKS welding equipment procedures and guidelines
|
||||
- Check equipment approval and maintenance status
|
||||
@@ -1,76 +0,0 @@
|
||||
# NCR Creator User Guide
|
||||
|
||||
## What is the NCR Creator Module?
|
||||
|
||||
The NCR Creator module allows users to create and manage Non-Conformance Reports (NCRs) for quality control issues. This module helps document quality problems, track corrective actions, and ensure proper resolution of non-conformances.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NCR Creator:
|
||||
1. Login to the system
|
||||
2. Click on **NCR** in the main menu
|
||||
3. Select **NCR Creator** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **NCR Creation**: Create new non-conformance reports
|
||||
- **Issue Documentation**: Document quality issues and problems
|
||||
- **Corrective Actions**: Track corrective actions and resolutions
|
||||
- **Approval Workflow**: Manage NCR approval and closure process
|
||||
|
||||
### Secondary Functions
|
||||
- **Template Management**: Use pre-built NCR templates
|
||||
- **Documentation**: Maintain NCR documentation and records
|
||||
- **Report Generation**: Generate NCR reports and analytics
|
||||
- **Status Tracking**: Track NCR status and progress
|
||||
|
||||
## How to Use
|
||||
|
||||
### Creating New NCRs
|
||||
1. Click **"Create New NCR"** button
|
||||
2. Select NCR category and type
|
||||
3. Describe the non-conformance issue
|
||||
4. Identify affected materials or components
|
||||
5. Assign responsible personnel
|
||||
6. Set priority and due dates
|
||||
7. Submit for approval
|
||||
|
||||
### NCR Management
|
||||
1. Review NCR details and requirements
|
||||
2. Assign corrective actions and responsibilities
|
||||
3. Track corrective action progress
|
||||
4. Document resolution and verification
|
||||
5. Close NCR when resolved
|
||||
|
||||
### NCR Categories
|
||||
- **Material Issues**: Material quality and specification problems
|
||||
- **Process Issues**: Process and procedure problems
|
||||
- **Equipment Issues**: Equipment and tool problems
|
||||
- **Documentation Issues**: Documentation and record problems
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Document issues clearly and completely
|
||||
- ✅ Assign appropriate priority levels
|
||||
- ✅ Follow up on corrective actions
|
||||
- ✅ Verify resolution before closing
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify NCR accuracy and completeness
|
||||
- ✅ Ensure proper corrective actions are taken
|
||||
- ✅ Monitor NCR resolution effectiveness
|
||||
- ✅ Regular review of NCR trends and patterns
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **NCR not saving**: Check all required fields are completed
|
||||
2. **Approval workflow stuck**: Contact NCR administrator
|
||||
3. **Corrective action not assigned**: Review NCR assignment process
|
||||
|
||||
### Getting Help
|
||||
- Contact the Quality Control department for technical support
|
||||
- Consult NCR procedures and templates
|
||||
- Check NCR status and approval workflow
|
||||
@@ -1,321 +0,0 @@
|
||||
# NCR Log User Guide
|
||||
|
||||
## What is NCR Log?
|
||||
|
||||
NCR Log manages Non-Conformance Reports - your system for documenting, tracking, and resolving quality issues. When something doesn't meet specifications, an NCR ensures it gets proper attention and resolution.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NCR Log:
|
||||
1. Login to the system
|
||||
2. Click on **NCR** in the main menu
|
||||
3. Select **NCR log** from the submenu
|
||||
|
||||
## Understanding Non-Conformances
|
||||
|
||||
### What is a Non-Conformance?
|
||||
A non-conformance occurs when:
|
||||
- **Materials** don't meet specifications
|
||||
- **Workmanship** falls below standards
|
||||
- **Procedures** aren't followed correctly
|
||||
- **Documentation** is incomplete or missing
|
||||
- **Safety** requirements are violated
|
||||
|
||||
### When to Create an NCR
|
||||
Always create an NCR for:
|
||||
- ✅ Failed inspections or tests
|
||||
- ✅ Damaged materials or equipment
|
||||
- ✅ Procedure violations
|
||||
- ✅ Safety incidents
|
||||
- ✅ Client-identified issues
|
||||
- ✅ Supplier quality problems
|
||||
|
||||
## Creating a New NCR
|
||||
|
||||
### Starting an NCR
|
||||
1. Click **"Create New NCR"** button
|
||||
2. Fill in basic information:
|
||||
- **NCR Number**: Usually auto-generated
|
||||
- **Date Identified**: When issue was found
|
||||
- **Identified By**: Who found the problem
|
||||
- **Location/Area**: Where the issue occurred
|
||||
|
||||
### Problem Description
|
||||
**Be Specific and Clear:**
|
||||
- **What exactly** is wrong?
|
||||
- **Where precisely** is the problem?
|
||||
- **When** was it discovered?
|
||||
- **How extensive** is the issue?
|
||||
- **What standards** are not met?
|
||||
|
||||
### Supporting Evidence
|
||||
**Document Everything:**
|
||||
- **Photos**: Take clear pictures of the problem
|
||||
- **Measurements**: Record actual vs required dimensions
|
||||
- **Test Results**: Include failed inspection reports
|
||||
- **Drawings**: Reference applicable specifications
|
||||
- **Witnesses**: Note who else observed the issue
|
||||
|
||||
## Categorizing NCRs
|
||||
|
||||
### Severity Levels
|
||||
**🔴 Critical**: Immediate safety risk or major quality impact
|
||||
**🟡 Major**: Significant quality concern requiring prompt action
|
||||
**🟢 Minor**: Limited impact, can be addressed in normal schedule
|
||||
|
||||
### Issue Types
|
||||
- **Material Defect**: Raw material problems
|
||||
- **Workmanship**: Construction quality issues
|
||||
- **Design**: Drawing or specification problems
|
||||
- **Procedure**: Process not followed
|
||||
- **Documentation**: Missing or incorrect paperwork
|
||||
|
||||
### Affected Areas
|
||||
- **Welding**: Joint quality, procedure compliance
|
||||
- **Materials**: Incoming inspection, storage
|
||||
- **Testing**: NDT, pressure test failures
|
||||
- **Safety**: HSE violations
|
||||
- **Documentation**: Missing certificates, reports
|
||||
|
||||
## Investigation Process
|
||||
|
||||
### Immediate Actions
|
||||
1. **Secure the area** - prevent further non-conforming work
|
||||
2. **Document everything** - photos, measurements, conditions
|
||||
3. **Notify supervisors** - alert management immediately
|
||||
4. **Isolate materials** - segregate non-conforming items
|
||||
5. **Stop related work** - prevent spreading the problem
|
||||
|
||||
### Root Cause Analysis
|
||||
**Ask the 5 Whys:**
|
||||
1. **Why** did this happen?
|
||||
2. **Why** did that cause occur?
|
||||
3. **Why** wasn't it prevented?
|
||||
4. **Why** wasn't it caught earlier?
|
||||
5. **Why** did the system allow this?
|
||||
|
||||
### Investigation Team
|
||||
Typically includes:
|
||||
- **Quality Control** representative
|
||||
- **Area supervisor** or foreman
|
||||
- **Technical specialist** (if needed)
|
||||
- **Safety representative** (for safety issues)
|
||||
- **Client representative** (if required)
|
||||
|
||||
## Resolution Planning
|
||||
|
||||
### Correction Options
|
||||
**Repair**: Fix the defect to meet requirements
|
||||
**Rework**: Completely redo the work properly
|
||||
**Accept**: Use as-is with engineering approval
|
||||
**Reject**: Scrap and replace with conforming item
|
||||
|
||||
### Creating Action Plans
|
||||
1. **Define specific actions** needed
|
||||
2. **Assign responsibility** to individuals
|
||||
3. **Set realistic deadlines** for completion
|
||||
4. **Identify resources** required
|
||||
5. **Plan verification** activities
|
||||
|
||||
### Approval Process
|
||||
**Internal Approval:**
|
||||
- QC manager review
|
||||
- Technical authority approval
|
||||
- Safety sign-off (if applicable)
|
||||
- Cost impact assessment
|
||||
|
||||
**Client Approval:**
|
||||
- Submit for client review (if required)
|
||||
- Provide technical justification
|
||||
- Include repair procedures
|
||||
- Wait for written approval
|
||||
|
||||
## Tracking Resolution
|
||||
|
||||
### Status Updates
|
||||
**📝 Open**: NCR created, investigation starting
|
||||
**🔍 Under Investigation**: Analyzing root cause
|
||||
**📋 Action Plan Created**: Resolution plan approved
|
||||
**🔧 Implementation**: Corrective actions in progress
|
||||
**✅ Verification**: Checking if fix worked
|
||||
**📁 Closed**: Issue fully resolved
|
||||
|
||||
### Progress Monitoring
|
||||
Track these metrics:
|
||||
- **Days open**: How long until resolution?
|
||||
- **Cost impact**: What did it cost to fix?
|
||||
- **Repeat issues**: Same problem occurring again?
|
||||
- **Effectiveness**: Did the fix work completely?
|
||||
|
||||
### Communication
|
||||
**Keep Stakeholders Informed:**
|
||||
- **Regular updates** to management
|
||||
- **Progress reports** to client
|
||||
- **Lessons learned** shared with teams
|
||||
- **Trending analysis** for improvement
|
||||
|
||||
## Documentation Requirements
|
||||
|
||||
### NCR Package Contents
|
||||
Each NCR should include:
|
||||
- **Original NCR form** with all details
|
||||
- **Investigation report** with root cause
|
||||
- **Action plan** with assignments
|
||||
- **Implementation evidence** (photos, reports)
|
||||
- **Verification records** proving fix worked
|
||||
- **Approval signatures** from authorities
|
||||
|
||||
### Photo Documentation
|
||||
**Before Photos:**
|
||||
- Show the problem clearly
|
||||
- Include reference measurements
|
||||
- Document extent of issue
|
||||
- Take from multiple angles
|
||||
|
||||
**After Photos:**
|
||||
- Prove work was completed
|
||||
- Show quality of repair
|
||||
- Demonstrate compliance
|
||||
- Include final measurements
|
||||
|
||||
## Quality Metrics
|
||||
|
||||
### NCR Performance Indicators
|
||||
**Volume Trends:**
|
||||
- NCRs per month
|
||||
- Issues by category
|
||||
- Repeat problems
|
||||
- Cost of quality
|
||||
|
||||
**Resolution Efficiency:**
|
||||
- Average days to close
|
||||
- First-time fix rate
|
||||
- Rework percentage
|
||||
- Client satisfaction
|
||||
|
||||
### Continuous Improvement
|
||||
**Use NCR Data For:**
|
||||
- **Training needs** identification
|
||||
- **Procedure improvements**
|
||||
- **Supplier evaluations**
|
||||
- **System enhancements**
|
||||
- **Best practice** development
|
||||
|
||||
## Common NCR Scenarios
|
||||
|
||||
### Failed Weld Inspection
|
||||
1. **Document** the failed joint
|
||||
2. **Determine** repair requirements
|
||||
3. **Plan** corrective welding
|
||||
4. **Execute** repairs with qualified personnel
|
||||
5. **Re-inspect** to verify acceptance
|
||||
|
||||
### Material Non-Conformance
|
||||
1. **Quarantine** suspect materials
|
||||
2. **Verify** extent of problem
|
||||
3. **Notify** suppliers immediately
|
||||
4. **Determine** use/return decision
|
||||
5. **Implement** controls to prevent recurrence
|
||||
|
||||
### Procedure Violations
|
||||
1. **Stop** non-conforming work
|
||||
2. **Retrain** personnel involved
|
||||
3. **Review** procedure adequacy
|
||||
4. **Implement** additional controls
|
||||
5. **Monitor** for effectiveness
|
||||
|
||||
## Working with Teams
|
||||
|
||||
### QC Department
|
||||
- **Report issues** promptly and clearly
|
||||
- **Provide evidence** to support findings
|
||||
- **Cooperate** with investigations
|
||||
- **Follow** approved repair procedures
|
||||
|
||||
### Construction Teams
|
||||
- **Stop work** when problems identified
|
||||
- **Assist** with investigation
|
||||
- **Implement** corrective actions
|
||||
- **Prevent** similar issues
|
||||
|
||||
### Management
|
||||
- **Support** investigation resources
|
||||
- **Approve** resolution plans
|
||||
- **Monitor** implementation
|
||||
- **Drive** systematic improvements
|
||||
|
||||
## Mobile Access
|
||||
|
||||
### Field Reporting
|
||||
Use mobile devices to:
|
||||
- **Create NCRs** immediately when issues found
|
||||
- **Take photos** with location data
|
||||
- **Update status** from work areas
|
||||
- **Access** previous NCR data for reference
|
||||
|
||||
### Offline Capability
|
||||
- **Create reports** without internet
|
||||
- **Store photos** locally
|
||||
- **Sync data** when connection available
|
||||
- **Backup** critical information
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Prevention Focus
|
||||
- ✅ Train personnel properly
|
||||
- ✅ Follow procedures consistently
|
||||
- ✅ Inspect work regularly
|
||||
- ✅ Maintain equipment properly
|
||||
- ✅ Communicate requirements clearly
|
||||
|
||||
### Quick Response
|
||||
- ✅ Report issues immediately
|
||||
- ✅ Investigate thoroughly but quickly
|
||||
- ✅ Plan corrections carefully
|
||||
- ✅ Implement fixes promptly
|
||||
- ✅ Verify effectiveness completely
|
||||
|
||||
### Learning Organization
|
||||
- ✅ Share lessons learned
|
||||
- ✅ Update procedures based on experience
|
||||
- ✅ Train teams on common issues
|
||||
- ✅ Recognize improvement efforts
|
||||
- ✅ Celebrate zero-defect achievements
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**NCR won't save:**
|
||||
- Check all required fields completed
|
||||
- Verify user has creation permissions
|
||||
- Try refreshing page
|
||||
- Contact IT if problem persists
|
||||
|
||||
**Can't upload photos:**
|
||||
- Check file size (usually max 10MB each)
|
||||
- Ensure JPEG/PNG format
|
||||
- Try different browser
|
||||
- Compress large images
|
||||
|
||||
**Status won't update:**
|
||||
- Verify proper approval workflow
|
||||
- Check user permissions for status change
|
||||
- Ensure all required actions completed
|
||||
- Contact supervisor for process questions
|
||||
|
||||
## Getting Help
|
||||
|
||||
**For Technical Issues:**
|
||||
- Review this guide first
|
||||
- Try basic troubleshooting
|
||||
- Contact IT support with specific error messages
|
||||
- Provide NCR number for reference
|
||||
|
||||
**For Process Questions:**
|
||||
- Consult QC supervisor
|
||||
- Review project procedures
|
||||
- Check applicable standards
|
||||
- Ask experienced team members
|
||||
|
||||
Remember: NCRs are improvement tools, not blame assignments. Focus on fixing problems and preventing recurrence, not finding fault!
|
||||
@@ -1,75 +0,0 @@
|
||||
# NCR Status User Guide
|
||||
|
||||
## What is the NCR Status Module?
|
||||
|
||||
The NCR Status module tracks and monitors the status of Non-Conformance Reports (NCRs) throughout their lifecycle. This module helps manage NCR progress, track corrective actions, and ensure timely resolution of quality issues.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NCR Status:
|
||||
1. Login to the system
|
||||
2. Click on **NCR** in the main menu
|
||||
3. Select **NCR Status** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Status Tracking**: Track NCR status and progress
|
||||
- **Progress Monitoring**: Monitor corrective action progress
|
||||
- **Timeline Management**: Manage NCR timelines and due dates
|
||||
- **Reporting**: Generate NCR status reports
|
||||
|
||||
### Secondary Functions
|
||||
- **Dashboard View**: Overview of all NCRs and their status
|
||||
- **Filtering**: Filter NCRs by status, priority, or responsible person
|
||||
- **Notifications**: Alert system for overdue NCRs
|
||||
- **Analytics**: Analyze NCR trends and patterns
|
||||
|
||||
## How to Use
|
||||
|
||||
### Viewing NCR Status
|
||||
1. Access NCR Status module
|
||||
2. View NCR dashboard with status overview
|
||||
3. Filter NCRs by status or other criteria
|
||||
4. Click on specific NCR for detailed view
|
||||
5. Review progress and timeline
|
||||
|
||||
### Status Management
|
||||
1. Review NCR status and progress
|
||||
2. Update status as corrective actions progress
|
||||
3. Monitor due dates and timelines
|
||||
4. Escalate overdue NCRs
|
||||
5. Close completed NCRs
|
||||
|
||||
### Status Categories
|
||||
- **Open**: NCR created and assigned
|
||||
- **In Progress**: Corrective actions being implemented
|
||||
- **Under Review**: Corrective actions under review
|
||||
- **Closed**: NCR resolved and closed
|
||||
- **Overdue**: NCR past due date
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Monitor NCR status regularly
|
||||
- ✅ Update status promptly when progress is made
|
||||
- ✅ Follow up on overdue NCRs
|
||||
- ✅ Document status changes and reasons
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify corrective actions are effective
|
||||
- ✅ Ensure proper documentation of resolution
|
||||
- ✅ Monitor NCR trends and patterns
|
||||
- ✅ Regular review of NCR management process
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Status not updating**: Check user permissions and workflow
|
||||
2. **Overdue NCRs**: Review assignment and escalation process
|
||||
3. **Missing notifications**: Check notification settings
|
||||
|
||||
### Getting Help
|
||||
- Contact the Quality Control department for technical support
|
||||
- Consult NCR status procedures and guidelines
|
||||
- Check NCR assignment and escalation process
|
||||
@@ -1,76 +0,0 @@
|
||||
# NCR User Guide
|
||||
|
||||
## What is the NCR Module?
|
||||
|
||||
The NCR (Non-Conformance Report) module manages non-conformance reports and corrective actions. This module helps track non-conformances, manage corrective actions, and ensure proper NCR documentation and management.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NCR:
|
||||
1. Login to the system
|
||||
2. Click on **NCR** in the main menu
|
||||
3. Select **NCR** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **NCR Management**: Manage non-conformance reports
|
||||
- **Corrective Action Tracking**: Track corrective actions
|
||||
- **Report Management**: Manage NCR reports
|
||||
- **Documentation**: Maintain NCR documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate NCR reports
|
||||
- **Data Analysis**: Analyze NCR data and trends
|
||||
- **Export Options**: Export NCR data in various formats
|
||||
- **Compliance Monitoring**: Monitor NCR compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing NCR Reports
|
||||
1. Click **"Manage NCR"** button
|
||||
2. Select NCR for management
|
||||
3. Review non-conformance details
|
||||
4. Update NCR information
|
||||
5. Track corrective actions
|
||||
6. Generate NCR reports
|
||||
7. Monitor compliance
|
||||
|
||||
### NCR Management
|
||||
1. Review NCR reports
|
||||
2. Update non-conformance information
|
||||
3. Track corrective actions
|
||||
4. Monitor compliance
|
||||
5. Generate NCR reports
|
||||
|
||||
### NCR Categories
|
||||
- **Open NCRs**: Open non-conformance reports
|
||||
- **Closed NCRs**: Closed non-conformance reports
|
||||
- **Pending Actions**: Pending corrective actions
|
||||
- **Completed Actions**: Completed corrective actions
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Keep NCR data current and accurate
|
||||
- ✅ Monitor corrective actions regularly
|
||||
- ✅ Maintain proper documentation
|
||||
- ✅ Ensure compliance with standards
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify NCR data accuracy
|
||||
- ✅ Ensure proper corrective action management
|
||||
- ✅ Monitor NCR management effectiveness
|
||||
- ✅ Regular review of NCR processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **NCR not saving**: Check all required fields are completed
|
||||
2. **Action delays**: Review corrective action requirements
|
||||
3. **Compliance problems**: Verify compliance requirements
|
||||
|
||||
### Getting Help
|
||||
- Contact the NCR department for technical support
|
||||
- Consult NCR procedures and guidelines
|
||||
- Check NCR data and compliance status
|
||||
@@ -1,76 +0,0 @@
|
||||
# NDE Matrix User Guide
|
||||
|
||||
## What is the NDE Matrix Module?
|
||||
|
||||
The NDE Matrix module manages Non-Destructive Examination (NDE) matrices and testing requirements. This module helps define NDE requirements, manage testing matrices, and ensure proper NDE planning and execution.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NDE Matrix:
|
||||
1. Login to the system
|
||||
2. Click on **NDT** in the main menu
|
||||
3. Select **NDE Matrix** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Matrix Management**: Manage NDE testing matrices
|
||||
- **Requirement Definition**: Define NDE requirements
|
||||
- **Testing Planning**: Plan NDE testing activities
|
||||
- **Documentation**: Maintain matrix documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate matrix reports
|
||||
- **Data Analysis**: Analyze matrix data
|
||||
- **Export Options**: Export matrix data in various formats
|
||||
- **Compliance Monitoring**: Monitor matrix compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing NDE Matrix
|
||||
1. Click **"Manage Matrix"** button
|
||||
2. Select matrix for management
|
||||
3. Define NDE requirements
|
||||
4. Set testing parameters
|
||||
5. Configure matrix settings
|
||||
6. Update matrix information
|
||||
7. Generate matrix reports
|
||||
|
||||
### Matrix Management
|
||||
1. Review NDE matrix requirements
|
||||
2. Define testing parameters
|
||||
3. Configure matrix settings
|
||||
4. Monitor matrix compliance
|
||||
5. Generate matrix reports
|
||||
|
||||
### Matrix Categories
|
||||
- **Testing Matrices**: NDE testing requirements
|
||||
- **Quality Matrices**: Quality control matrices
|
||||
- **Compliance Matrices**: Compliance requirement matrices
|
||||
- **Custom Matrices**: User-defined matrices
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Define clear matrix requirements
|
||||
- ✅ Set appropriate testing parameters
|
||||
- ✅ Monitor matrix compliance
|
||||
- ✅ Maintain proper documentation
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify matrix accuracy and completeness
|
||||
- ✅ Ensure proper matrix configuration
|
||||
- ✅ Monitor matrix effectiveness
|
||||
- ✅ Regular review of matrix processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Matrix not saving**: Check all required fields are completed
|
||||
2. **Configuration errors**: Review matrix settings
|
||||
3. **Compliance issues**: Verify compliance requirements
|
||||
|
||||
### Getting Help
|
||||
- Contact the NDT department for technical support
|
||||
- Consult NDE matrix procedures and guidelines
|
||||
- Check matrix configuration and requirements
|
||||
@@ -1,76 +0,0 @@
|
||||
# NDT Calculation User Guide
|
||||
|
||||
## What is the NDT Calculation Module?
|
||||
|
||||
The NDT Calculation module provides calculation tools and formulas for Non-Destructive Testing (NDT) operations. This module helps perform NDT-related calculations, analyze test results, and ensure accurate data processing for quality control.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NDT Calculation:
|
||||
1. Login to the system
|
||||
2. Click on **NDT** in the main menu
|
||||
3. Select **NDT Calculation** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Calculation Tools**: Perform NDT-related calculations
|
||||
- **Formula Library**: Access NDT calculation formulas
|
||||
- **Data Analysis**: Analyze NDT test data and results
|
||||
- **Result Processing**: Process and validate calculation results
|
||||
|
||||
### Secondary Functions
|
||||
- **Template Management**: Use pre-built calculation templates
|
||||
- **Documentation**: Maintain calculation procedures and records
|
||||
- **Report Generation**: Generate calculation reports
|
||||
- **Validation**: Validate calculation accuracy and results
|
||||
|
||||
## How to Use
|
||||
|
||||
### Performing Calculations
|
||||
1. Click **"New Calculation"** button
|
||||
2. Select calculation type and method
|
||||
3. Enter input data and parameters
|
||||
4. Choose appropriate formulas
|
||||
5. Execute calculation
|
||||
6. Review and validate results
|
||||
7. Save calculation record
|
||||
|
||||
### Calculation Types
|
||||
- **Radiographic Calculations**: RT exposure and geometry calculations
|
||||
- **Ultrasonic Calculations**: UT velocity and thickness calculations
|
||||
- **Magnetic Particle Calculations**: MT field strength calculations
|
||||
- **Penetrant Calculations**: PT sensitivity calculations
|
||||
|
||||
### Data Management
|
||||
1. Review input data accuracy
|
||||
2. Verify calculation parameters
|
||||
3. Validate calculation results
|
||||
4. Document calculation procedures
|
||||
5. Generate calculation reports
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Verify input data accuracy before calculation
|
||||
- ✅ Use appropriate formulas and methods
|
||||
- ✅ Validate calculation results
|
||||
- ✅ Document calculation procedures and results
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Check calculation accuracy and precision
|
||||
- ✅ Verify formula selection and application
|
||||
- ✅ Monitor calculation trends and patterns
|
||||
- ✅ Regular review of calculation procedures
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Calculation errors**: Check input data and formula selection
|
||||
2. **Invalid results**: Verify calculation parameters and methods
|
||||
3. **Formula issues**: Contact NDT supervisor for resolution
|
||||
|
||||
### Getting Help
|
||||
- Contact the NDT department for technical support
|
||||
- Consult NDT calculation procedures and standards
|
||||
- Check calculation formulas and methods
|
||||
@@ -1,76 +0,0 @@
|
||||
# NDT Clearance Report User Guide
|
||||
|
||||
## What is the NDT Clearance Report Module?
|
||||
|
||||
The NDT Clearance Report module generates and manages Non-Destructive Testing (NDT) clearance reports. This module helps track NDT completion status, generate clearance reports, and ensure proper NDT documentation and reporting.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NDT Clearance Report:
|
||||
1. Login to the system
|
||||
2. Click on **Employees** in the main menu
|
||||
3. Select **NDT Clearance Report** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Report Generation**: Generate NDT clearance reports
|
||||
- **Status Tracking**: Track NDT clearance status
|
||||
- **Documentation**: Maintain clearance documentation
|
||||
- **Compliance Monitoring**: Monitor NDT compliance
|
||||
|
||||
### Secondary Functions
|
||||
- **Data Analysis**: Analyze NDT clearance data
|
||||
- **Export Options**: Export reports in various formats
|
||||
- **Filtering**: Filter and search clearance data
|
||||
- **Notification System**: Notify relevant parties of clearance status
|
||||
|
||||
## How to Use
|
||||
|
||||
### Generating Clearance Reports
|
||||
1. Click **"Generate Report"** button
|
||||
2. Select NDT type and date range
|
||||
3. Choose report format and parameters
|
||||
4. Generate clearance report
|
||||
5. Review report content
|
||||
6. Export or print report
|
||||
7. Distribute report as needed
|
||||
|
||||
### Report Management
|
||||
1. Review NDT clearance data
|
||||
2. Generate clearance reports
|
||||
3. Analyze clearance trends
|
||||
4. Monitor compliance status
|
||||
5. Distribute reports
|
||||
|
||||
### Report Categories
|
||||
- **RT Clearance**: Radiographic testing clearance
|
||||
- **UT Clearance**: Ultrasonic testing clearance
|
||||
- **PT Clearance**: Penetrant testing clearance
|
||||
- **MT Clearance**: Magnetic testing clearance
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Generate reports regularly and promptly
|
||||
- ✅ Verify report accuracy and completeness
|
||||
- ✅ Monitor clearance compliance
|
||||
- ✅ Distribute reports to relevant parties
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify report data accuracy
|
||||
- ✅ Ensure proper report formatting
|
||||
- ✅ Monitor report generation effectiveness
|
||||
- ✅ Regular review of report processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Report not generating**: Check data availability and permissions
|
||||
2. **Data errors**: Verify NDT data accuracy and completeness
|
||||
3. **Export problems**: Check export format and file size
|
||||
|
||||
### Getting Help
|
||||
- Contact the Employees department for technical support
|
||||
- Consult NDT clearance report procedures and guidelines
|
||||
- Check NDT data and clearance status
|
||||
@@ -1,74 +0,0 @@
|
||||
# NDT Dashboard User Guide
|
||||
|
||||
## What is the NDT Dashboard Module?
|
||||
|
||||
The NDT Dashboard module provides a comprehensive overview of all Non-Destructive Testing (NDT) activities and operations. This module displays key metrics, status updates, and performance indicators for NDT operations in a centralized dashboard view.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NDT Dashboard:
|
||||
1. Login to the system
|
||||
2. Click on **NDT** in the main menu
|
||||
3. Select **NDT Dashboard** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Overview Display**: Display NDT operations overview
|
||||
- **Status Monitoring**: Monitor NDT activity status
|
||||
- **Performance Tracking**: Track NDT performance metrics
|
||||
- **Quick Access**: Quick access to NDT tools and functions
|
||||
|
||||
### Secondary Functions
|
||||
- **Metrics Display**: Display key NDT performance metrics
|
||||
- **Alert System**: Alert system for NDT issues and deadlines
|
||||
- **Report Access**: Quick access to NDT reports
|
||||
- **Navigation**: Easy navigation to NDT modules
|
||||
|
||||
## How to Use
|
||||
|
||||
### Dashboard Navigation
|
||||
1. Access NDT Dashboard
|
||||
2. Review overview metrics and status
|
||||
3. Click on specific metrics for detailed view
|
||||
4. Navigate to specific NDT modules
|
||||
5. Access reports and analytics
|
||||
|
||||
### Dashboard Features
|
||||
1. Review NDT activity status
|
||||
2. Monitor performance metrics
|
||||
3. Check alerts and notifications
|
||||
4. Access quick actions and tools
|
||||
5. Generate dashboard reports
|
||||
|
||||
### Dashboard Sections
|
||||
- **Activity Overview**: Current NDT activities and status
|
||||
- **Performance Metrics**: Key performance indicators
|
||||
- **Alerts and Notifications**: Important alerts and deadlines
|
||||
- **Quick Actions**: Common NDT actions and tools
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Review dashboard regularly for updates
|
||||
- ✅ Monitor key metrics and performance indicators
|
||||
- ✅ Respond to alerts and notifications promptly
|
||||
- ✅ Use dashboard for quick access to NDT functions
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify dashboard data accuracy
|
||||
- ✅ Monitor dashboard performance and responsiveness
|
||||
- ✅ Regular review of dashboard metrics and trends
|
||||
- ✅ Update dashboard configuration as needed
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Dashboard not loading**: Check system status and connectivity
|
||||
2. **Data not updating**: Refresh dashboard or check data sources
|
||||
3. **Metrics errors**: Contact system administrator
|
||||
|
||||
### Getting Help
|
||||
- Contact the NDT department for technical support
|
||||
- Consult dashboard configuration and settings
|
||||
- Check system status and data sources
|
||||
@@ -1,76 +0,0 @@
|
||||
# NDT Order User Guide
|
||||
|
||||
## What is the NDT Order Module?
|
||||
|
||||
The NDT Order module manages Non-Destructive Testing (NDT) orders and testing requests. This module helps create NDT orders, track order status, and ensure proper NDT testing coordination and management.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NDT Order:
|
||||
1. Login to the system
|
||||
2. Click on **NDT** in the main menu
|
||||
3. Select **NDT Order** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Order Management**: Manage NDT testing orders
|
||||
- **Request Processing**: Process NDT testing requests
|
||||
- **Status Tracking**: Track order status and progress
|
||||
- **Coordination**: Coordinate NDT testing activities
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate order reports
|
||||
- **Notification System**: Notify relevant parties
|
||||
- **Documentation**: Maintain order documentation
|
||||
- **Compliance Monitoring**: Monitor order compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing NDT Orders
|
||||
1. Click **"Create Order"** button
|
||||
2. Select NDT testing type
|
||||
3. Define testing requirements
|
||||
4. Set testing schedule
|
||||
5. Assign testing personnel
|
||||
6. Track order progress
|
||||
7. Generate order reports
|
||||
|
||||
### Order Management
|
||||
1. Review NDT testing requirements
|
||||
2. Create testing orders
|
||||
3. Track order status
|
||||
4. Coordinate testing activities
|
||||
5. Generate order reports
|
||||
|
||||
### Order Categories
|
||||
- **RT Orders**: Radiographic testing orders
|
||||
- **UT Orders**: Ultrasonic testing orders
|
||||
- **PT Orders**: Penetrant testing orders
|
||||
- **MT Orders**: Magnetic testing orders
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Create clear and detailed orders
|
||||
- ✅ Track order status regularly
|
||||
- ✅ Coordinate testing activities
|
||||
- ✅ Maintain proper documentation
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify order accuracy and completeness
|
||||
- ✅ Ensure proper order processing
|
||||
- ✅ Monitor order management effectiveness
|
||||
- ✅ Regular review of order processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Order not creating**: Check all required fields are completed
|
||||
2. **Status not updating**: Verify order processing workflow
|
||||
3. **Coordination issues**: Review testing coordination requirements
|
||||
|
||||
### Getting Help
|
||||
- Contact the NDT department for technical support
|
||||
- Consult NDT order procedures and guidelines
|
||||
- Check order status and coordination requirements
|
||||
@@ -1,46 +0,0 @@
|
||||
# NDT Request – PT Request Date Test Data
|
||||
|
||||
This document lists **weld_logs** rows where the mobile app can successfully save **PT Request Date** (backend validation allows new request).
|
||||
|
||||
## Validation rule (backend)
|
||||
|
||||
- **Blocked** if the joint has `welding_date` set.
|
||||
- **Blocked** if the joint has **any** `*_request_no` set (VT, RT, UT, PT, MT, PMI, PWHT, HT, Ferrite).
|
||||
- **Allowed** only when `welding_date` is empty and all request numbers are empty.
|
||||
|
||||
## Test records (eligible for PT request date)
|
||||
|
||||
All of these have `welding_date = null` and all `*_request_no` fields empty.
|
||||
|
||||
| ID | ISO Number | Joint | Spool | Line Number |
|
||||
|----|-------------------------|-------|---------|------------------------|
|
||||
| 75 | IA-80-AH01JL-FA00.100 | 5 | SPL-0001| IA-80-AH01JL-FA00.100 |
|
||||
| 82 | IA-80-AH01JL-FA00.100 | 10 | SPL-0002| IA-80-AH01JL-FA00.100 |
|
||||
| 88 | IA-80-AH01JL-FA00.100 | 16 | SPL-0003| IA-80-AH01JL-FA00.100 |
|
||||
| 90 | IA-80-AH01JL-FA00.100 | 18 | SPL-0003| IA-80-AH01JL-FA00.100 |
|
||||
| 94 | IA-80-AH01JL-FA00.100 | 22 | SPL-0003| IA-80-AH01JL-FA00.100 |
|
||||
|
||||
## Recommended test row
|
||||
|
||||
- **ID: 75**
|
||||
- **ISO Number:** IA-80-AH01JL-FA00.100
|
||||
- **Joint:** 5
|
||||
- **Spool:** SPL-0001
|
||||
|
||||
## How to test in the app
|
||||
|
||||
1. Open **NDT Request** on the mobile app.
|
||||
2. Use filters if needed: **ISO No** = `IA-80-AH01JL-FA00.100`, **Joint No** = `5`, **Spool No** = `SPL-0001` (or scroll to find Line `IA-80-AH01JL-FA00.100`, Joint 5, Spool SPL-0001).
|
||||
3. Open the row (ID 75).
|
||||
4. Set **PT** → **Request Date** (e.g. 05/02/2026) and optionally **NDT company**.
|
||||
5. Save.
|
||||
6. In DB, confirm: `weld_logs.pt_request_date` for `id = 75` is updated.
|
||||
|
||||
```sql
|
||||
SELECT id, iso_number, no_of_the_joint_as_per_as_built_survey, spool_number, pt_request_date, pt_request_no
|
||||
FROM weld_logs WHERE id = 75;
|
||||
```
|
||||
|
||||
## Note
|
||||
|
||||
The record you tried earlier (ISO: kw-300-AH03JS-FA00.100-HC, Joint: 29, Spool: SPL0009) is likely **rejected** by the backend because that joint has `welding_date` set and/or at least one `*_request_no` set. Use one of the rows above to verify that PT request date is saved correctly.
|
||||
@@ -1,76 +0,0 @@
|
||||
# NDT User Guide
|
||||
|
||||
## What is the NDT Module?
|
||||
|
||||
The NDT (Non-Destructive Testing) module manages non-destructive testing operations and procedures. This module helps track NDT activities, manage testing procedures, and ensure proper NDT documentation and quality control.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access NDT:
|
||||
1. Login to the system
|
||||
2. Click on **NDT** in the main menu
|
||||
3. Select **NDT** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **NDT Management**: Manage non-destructive testing operations
|
||||
- **Testing Tracking**: Track NDT testing activities
|
||||
- **Procedure Management**: Manage testing procedures
|
||||
- **Documentation**: Maintain NDT documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate NDT reports
|
||||
- **Data Analysis**: Analyze NDT data and trends
|
||||
- **Export Options**: Export NDT data in various formats
|
||||
- **Compliance Monitoring**: Monitor NDT compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing NDT Operations
|
||||
1. Click **"Manage NDT"** button
|
||||
2. Select NDT operation for management
|
||||
3. Review testing procedures
|
||||
4. Update NDT information
|
||||
5. Track testing results
|
||||
6. Generate NDT reports
|
||||
7. Monitor compliance
|
||||
|
||||
### NDT Management
|
||||
1. Review NDT operations
|
||||
2. Update testing procedures
|
||||
3. Track testing results
|
||||
4. Monitor compliance
|
||||
5. Generate NDT reports
|
||||
|
||||
### NDT Categories
|
||||
- **Testing Operations**: NDT testing operations
|
||||
- **Testing Procedures**: NDT testing procedures
|
||||
- **Quality Control**: NDT quality control
|
||||
- **Compliance Tracking**: NDT compliance tracking
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Follow NDT procedures accurately
|
||||
- ✅ Monitor testing results regularly
|
||||
- ✅ Maintain proper documentation
|
||||
- ✅ Ensure compliance with standards
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify NDT procedure accuracy
|
||||
- ✅ Ensure proper quality control
|
||||
- ✅ Monitor NDT management effectiveness
|
||||
- ✅ Regular review of NDT processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Testing errors**: Check NDT procedures and equipment
|
||||
2. **Quality issues**: Review quality control procedures
|
||||
3. **Compliance problems**: Verify compliance requirements
|
||||
|
||||
### Getting Help
|
||||
- Contact the NDT department for technical support
|
||||
- Consult NDT procedures and guidelines
|
||||
- Check NDT equipment and compliance status
|
||||
@@ -1,853 +0,0 @@
|
||||
# 🔔 Notification System Guide
|
||||
|
||||
**Version:** 4.0 (Real-Time System)
|
||||
**Last Updated:** December 11, 2025
|
||||
**Branch:** feature-notification-log-11122025
|
||||
|
||||
---
|
||||
|
||||
## 🆕 Version 4 - Real-Time Notification System
|
||||
|
||||
**New Features (v4 - 2025-12-06):**
|
||||
- ✅ **Real-time notifications:** Runs every 5 minutes (maximum 5 minutes delay)
|
||||
- ✅ **Duplicate prevention:** Same issue won't trigger duplicate notifications
|
||||
- ✅ **Incremental checking:** First run scans all records, subsequent runs check only new records
|
||||
- ✅ **90%+ performance improvement:** Only new records are checked
|
||||
- ✅ **Synchronous execution:** Compatible with cronjob
|
||||
|
||||
**How It Works:**
|
||||
1. **First run:** Scans entire table, collects IDs of all problematic records
|
||||
2. **Subsequent runs:** Checks only new records created after last notification
|
||||
3. **5-minute check:** If run again within 5 minutes, it's skipped (performance optimization)
|
||||
4. **Duplicate check:** If notification exists for same issue and no new records, it's skipped
|
||||
|
||||
**Helper Functions:** `app/Functions/notification-state-helper.php`
|
||||
- `getLastNotificationTime()` - Get last notification timestamp
|
||||
- `shouldCheckNotification()` - Check if 5 minutes have passed
|
||||
- `getLastCheckTimestamp()` - Get last check timestamp (null = first run)
|
||||
- `isNotificationDuplicate()` - Check for duplicate notifications
|
||||
- `getAlreadyNotifiedIds()` - Get already notified record IDs
|
||||
|
||||
**Performance:**
|
||||
| Scenario | Duration | Description |
|
||||
|----------|----------|-------------|
|
||||
| First run | 2-10 seconds | Entire table scanned |
|
||||
| Within 5 min | < 0.1 seconds | Skip (no query) |
|
||||
| After 5 min (no new) | 0.1-0.5 seconds | Only new records checked |
|
||||
| New records exist | 0.1-1 seconds | Only new records checked |
|
||||
|
||||
---
|
||||
|
||||
## 📋 Quick Reference
|
||||
|
||||
| # | Notification Type | Trigger | Schedule | Permission Code |
|
||||
|---|-------------------|---------|----------|-----------------|
|
||||
| 1 | Deleted Joints Missing Comments | Scheduled | Every 5 min | `notification_deleted_joint_missing_comment` |
|
||||
| 2 | Repair Logs Missing New Joint Number | Scheduled | Every 5 min | `notification_repair_log_missing_new_joint` |
|
||||
| 3 | Daily Repair Rate Exceeds 12% | Scheduled | Every 5 min | `notification_daily_repair_rate_high` |
|
||||
| 4 | Line List Missing Required Data | Scheduled | Every 5 min | `notification_line_list_missing_data` |
|
||||
| 5 | WPS PDF Document Missing | Scheduled | Every 5 min | `notification_wps_pdf_missing` |
|
||||
| 6 | NAKS Welder Certificate Missing | Scheduled | Every 5 min | `notification_naks_welder_cert_missing` |
|
||||
| 7 | Welding Equipment PDF Missing | Scheduled | Every 5 min | `notification_welding_equipment_pdf_missing` |
|
||||
| 8 | WPQR PDF Missing | Scheduled | Every 5 min | `notification_wpq_followup_pdf_missing` |
|
||||
| 9 | Certificate Number 1-2 Missing | Scheduled | Every 5 min | `notification_weldlog_certificate_missing` |
|
||||
| 10 | Incoming Control Certificate Missing | Scheduled | Every 5 min | `notification_incoming_control_cert_missing` |
|
||||
| 11 | Welder ID Card Created | Event (Insert) | Immediate | `notification_welder_id_card_created` |
|
||||
| 12 | Document Revision Changed | Event (Update) | Immediate | `notification_document_revision_changed` |
|
||||
| 13 | NDE Matrix Not in Weldlog | Scheduled | Every 5 min | `notification_nde_matrix_not_in_weldlog` |
|
||||
| 14 | Weldlog Not in Line List | Scheduled | Every 5 min | `notification_weldlog_not_in_line_list` |
|
||||
| 15 | Line List NDT Missing | Scheduled | Every 5 min | `notification_line_list_ndt_missing` |
|
||||
| 16 | NDT PMI Test Missing | Scheduled | Every 5 min | `notification_ndt_pmi_missing` |
|
||||
| 17 | NDT FN Test Missing | Scheduled | Every 5 min | `notification_ndt_fn_missing` |
|
||||
| 18 | Unnecessary NDT Requests | Scheduled | Every 5 min | `notification_manage_ndt_unnecessary` |
|
||||
| 19 | Support Log Missing in Weldlog | Scheduled | Every 5 min | `notification_support_log_missing_in_weldlog` |
|
||||
| 20 | Paint System Missing | Scheduled | Every 5 min | `notification_paint_system_incomplete` |
|
||||
| 21 | Overall Repair Rate Exceeds 5% | Scheduled | Every 5 min | `notification_overall_repair_rate_high` |
|
||||
| 22 | Weldlog Test Date Before Welding Date | Scheduled | Every 5 min | `notification_weldlog_test_date_invalid` |
|
||||
| 23 | NDE Matrix Empty Row - NDT Assignment Required | Scheduled | Every 5 min | `notification_nde_matrix_empty_row` |
|
||||
| 24 | NDT Request Overdue (10+ Days) | Scheduled | Every 5 min | `notification_ndt_request_overdue` |
|
||||
| 25 | VT Test - PDF Report Missing | Scheduled | Every 5 min | `notification_test_log_pdf_missing_vt` |
|
||||
| 26 | RT Test - PDF Report Missing | Scheduled | Every 5 min | `notification_test_log_pdf_missing_rt` |
|
||||
| 27 | UT Test - PDF Report Missing | Scheduled | Every 5 min | `notification_test_log_pdf_missing_ut` |
|
||||
| 28 | PT Test - PDF Report Missing | Scheduled | Every 5 min | `notification_test_log_pdf_missing_pt` |
|
||||
| 29 | MT Test - PDF Report Missing | Scheduled | Every 5 min | `notification_test_log_pdf_missing_mt` |
|
||||
| 30 | HT Test - PDF Report Missing | Scheduled | Every 5 min | `notification_test_log_pdf_missing_ht` |
|
||||
| 31 | PMI Test - PDF Report Missing | Scheduled | Every 5 min | `notification_test_log_pdf_missing_pmi` |
|
||||
| 32 | PWHT Test - PDF Report Missing | Scheduled | Every 5 min | `notification_test_log_pdf_missing_pwht` |
|
||||
| 33 | Ferrite Test - PDF Report Missing | Scheduled | Every 5 min | `notification_test_log_pdf_missing_ferrite` |
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Getting Started
|
||||
|
||||
### Prerequisites
|
||||
1. Laravel Scheduler must be running (cron job)
|
||||
2. User roles must be assigned in Settings
|
||||
3. Helper functions loaded (`app/Functions/notification-state-helper.php`)
|
||||
|
||||
### System Status
|
||||
- ✅ Real-time notifications (every 5 minutes)
|
||||
- ✅ Duplicate prevention active
|
||||
- ✅ Incremental checking (only new records)
|
||||
- ✅ First run scans all records, subsequent runs check only new data
|
||||
|
||||
### Testing Notifications
|
||||
|
||||
#### Step 1: Configure Permissions
|
||||
```
|
||||
Navigate to: Settings → Specific Permissions → Notification Settings
|
||||
Assign your role (e.g., QC Manager) to the notification types you want to receive
|
||||
```
|
||||
|
||||
#### Step 2: Trigger Manually (for testing)
|
||||
```bash
|
||||
# Test a specific notification
|
||||
php artisan notifications:check-deleted-joints
|
||||
|
||||
# Test all NDT reminders
|
||||
php artisan notifications:check-ndt
|
||||
|
||||
# Test repair rate check
|
||||
php artisan notifications:check-daily-repair-rate
|
||||
```
|
||||
|
||||
#### Step 3: Check Results
|
||||
- Click the **bell icon** (🔔) in the header
|
||||
- Or visit: `/admin/types/my-notifications`
|
||||
|
||||
---
|
||||
|
||||
## 📦 Notification Types (Detailed)
|
||||
|
||||
### 1️⃣ Deleted Joints Missing Comments
|
||||
|
||||
**When:** Joints are deleted without explanation
|
||||
**Why:** Quality tracking requires deletion reasons
|
||||
**Command:** `notifications:check-deleted-joints`
|
||||
|
||||
**What to check:**
|
||||
```sql
|
||||
SELECT * FROM deleted_joints
|
||||
WHERE (comment IS NULL OR comment = '')
|
||||
LIMIT 50
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Deleted joint W-123 (Spool: SP-001, ISO: ISO-456) has no comment.
|
||||
Please add deletion reason.
|
||||
```
|
||||
|
||||
**Fix:** Add a comment in the Deleted Joints page explaining why it was removed.
|
||||
|
||||
---
|
||||
|
||||
### 2️⃣ Repair Logs Missing New Joint Number
|
||||
|
||||
**When:** Repairs completed but new joint number not assigned
|
||||
**Why:** Tracking requires new joint identification after repair
|
||||
**Command:** `notifications:check-repair-log-new-joint`
|
||||
|
||||
**What to check:**
|
||||
```sql
|
||||
SELECT * FROM repair_logs
|
||||
WHERE (new_joint_no IS NULL OR new_joint_no = '')
|
||||
LIMIT 50
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Repair log for joint W-OLD (Spool: SP-002, ISO: ISO-789) has no new joint number assigned.
|
||||
```
|
||||
|
||||
**Fix:** Assign the new joint number in Repair Log module.
|
||||
|
||||
---
|
||||
|
||||
### 3️⃣ Daily Repair Rate Exceeds 12%
|
||||
|
||||
**When:** Daily repair rate is too high (quality issue)
|
||||
**Why:** Alert QC teams when repair rate exceeds acceptable threshold
|
||||
**Command:** `notifications:check-daily-repair-rate`
|
||||
|
||||
**Calculation:**
|
||||
```
|
||||
Repair Rate = (Today's Repairs / Today's Welds) × 100
|
||||
Alert if > 12%
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Daily repair rate is 15.2% (19 repairs out of 125 welds).
|
||||
Please investigate quality issues.
|
||||
```
|
||||
|
||||
**Fix:** Investigate root cause - check welder qualifications, materials, procedures.
|
||||
|
||||
---
|
||||
|
||||
### 4️⃣ Line List Missing Required Data
|
||||
|
||||
**When:** Line List entries missing critical fields
|
||||
**Why:** Incomplete line data causes downstream issues
|
||||
**Command:** `notifications:check-line-list-missing-data`
|
||||
|
||||
**Required Fields:**
|
||||
- Category/Group
|
||||
- NDT Ratio
|
||||
- Pressure
|
||||
- Temperature
|
||||
- Test Type
|
||||
- Test Media
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Line ABC-123 (used in weld logs) is missing required data: NDT Ratio, Test Type
|
||||
```
|
||||
|
||||
**Fix:** Complete the missing fields in Line List module.
|
||||
|
||||
---
|
||||
|
||||
### 5️⃣-8️⃣ PDF Documents Missing
|
||||
|
||||
**When:** Required PDFs not uploaded
|
||||
**Why:** Documentation compliance
|
||||
**Command:** `notifications:check-pdf-documents`
|
||||
|
||||
**Checks:**
|
||||
- **WPS:** `w_p_s` table → `download` field
|
||||
- **NAKS Welder:** `naks_welders` table → `certificate` field
|
||||
- **Welding Equipment:** `welding_equipment` table → `download` field
|
||||
- **WPQ Follow-Up:** `welder_tests` table → `download` field
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
WPS WPS-001 is missing PDF document. Please upload procedure file.
|
||||
```
|
||||
|
||||
**Fix:** Upload the missing PDF in respective module.
|
||||
|
||||
---
|
||||
|
||||
### 9️⃣ Certificate Number 1-2 Missing
|
||||
|
||||
**When:** Welding completed but certificates not recorded
|
||||
**Why:** Certificate tracking for quality assurance
|
||||
**Command:** `notifications:check-weldlog-certificate`
|
||||
|
||||
**Condition:**
|
||||
```
|
||||
welding_date is filled
|
||||
AND (certificate_number_of_1 is empty OR certificate_number_of_2 is empty)
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Weldlog joint W-456 is missing: Certificate No 1, Certificate No 2
|
||||
(welded on 2025-12-06)
|
||||
```
|
||||
|
||||
**Fix:** Add certificate numbers in Weldlog module.
|
||||
|
||||
---
|
||||
|
||||
### 🔟 Incoming Control Certificate Missing
|
||||
|
||||
**When:** Materials received but certificates not logged
|
||||
**Why:** Material traceability requirement
|
||||
**Command:** `notifications:check-incoming-control-certificate`
|
||||
|
||||
**Condition:**
|
||||
```
|
||||
Record exists (created_at is not null)
|
||||
AND certificate_no is empty
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Incoming Control record MAT-789 is missing Certificate No
|
||||
```
|
||||
|
||||
**Fix:** Add certificate number in Incoming Control module.
|
||||
|
||||
---
|
||||
|
||||
### 1️⃣1️⃣ Welder ID Card Created (Event-Based)
|
||||
|
||||
**When:** New welder added to NAKS Welder database
|
||||
**Why:** Informational - notify teams about new qualified welder
|
||||
**Trigger:** Automatic on insert to `naks_welders` table
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
New Welder ID Card created for John Smith (Welder ID: W-1234)
|
||||
```
|
||||
|
||||
**Action:** Review the Welder ID Card page to verify information.
|
||||
|
||||
---
|
||||
|
||||
### 1️⃣2️⃣ Document Revision Changed (Event-Based)
|
||||
|
||||
**When:** REV number is updated in Document Revision module
|
||||
**Why:** PDF files must be updated when revision changes
|
||||
**Trigger:** Automatic on update to `document_revisions` table
|
||||
|
||||
**Condition:**
|
||||
```
|
||||
revision_no field changed (e.g., "0" → "1")
|
||||
AND oldValue is not empty (not initial creation)
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Document Revision REV changed from 0 to 1 for Drawing ABC-123.
|
||||
Please update PDF files.
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/document-revision?id={id}`
|
||||
|
||||
**How to Test:**
|
||||
1. Go to Settings → Specific Permissions → Notification Settings
|
||||
2. Assign roles to "Document Revision Changed"
|
||||
3. Open Document Revision module
|
||||
4. Change REV number of an existing record (0 → 1)
|
||||
5. Check notifications immediately after update
|
||||
|
||||
**Action:**
|
||||
- Update `pdf_engineering` file with new revision
|
||||
- Update `pdf_spool_iso` file if applicable
|
||||
- Ensure all PDF files reflect the new REV number
|
||||
|
||||
---
|
||||
|
||||
### 1️⃣3️⃣ NDE Matrix Not in Weldlog
|
||||
|
||||
**When:** NDE Matrix contains line numbers not found in Weldlog
|
||||
**Why:** Data consistency - NDE Matrix should reflect actual welding work
|
||||
**Command:** `notifications:check-nde-matrix-discrepancies`
|
||||
|
||||
**Check:**
|
||||
```
|
||||
NDE Matrix has line number
|
||||
BUT
|
||||
Weldlog does NOT have matching line_number
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
NDE Matrix line "ABC-123" (Project: P001, Joint Type: BW) not found in Weldlog
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/nde-matrix?line={line}`
|
||||
|
||||
---
|
||||
|
||||
### 1️⃣4️⃣ Weldlog Not in Line List
|
||||
|
||||
**When:** Welding performed on lines not defined in Line List
|
||||
**Why:** All welded lines must be predefined in Line List
|
||||
**Command:** `notifications:check-nde-matrix-discrepancies`
|
||||
|
||||
**Check:**
|
||||
```
|
||||
Weldlog has line_number (with welding_date filled)
|
||||
BUT
|
||||
Line List does NOT have matching line_no
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Weldlog line "DEF-456" (Project: P002, ISO: ISO-789) not found in Line List
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/weldlog?line_number={line_number}`
|
||||
|
||||
**Action:** Add the line to Line List module with complete specifications.
|
||||
|
||||
---
|
||||
|
||||
### 1️⃣5️⃣ Line List NDT Missing
|
||||
|
||||
**When:** Line List entry lacks NDT ratio but is used in welding
|
||||
**Why:** NDT ratio must be defined before welding begins
|
||||
**Command:** `notifications:check-nde-matrix-discrepancies`
|
||||
|
||||
**Check:**
|
||||
```
|
||||
Line List entry exists
|
||||
AND used in Weldlog (welding_date is not null)
|
||||
BUT
|
||||
Line List.ndt is empty or 0
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Line List entry "GHI-789" is missing NDT ratio (used in Weldlog)
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/line-list?line_no={line_no}`
|
||||
|
||||
**Action:** Update Line List with correct NDT percentage.
|
||||
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
### 1️⃣6️⃣ NDT PMI Test Missing
|
||||
|
||||
**When:** SS or CS+SS materials but PMI test request not created
|
||||
**Why:** PMI (Positive Material Identification) required for stainless steel materials
|
||||
**Command:** `notifications:check-ndt-calculation`
|
||||
|
||||
**Condition:**
|
||||
```
|
||||
welding_date is filled
|
||||
AND (Material Grade 1 or 2 = SS (11, 8, 9) OR CS+SS combination)
|
||||
AND pmi_request_no is empty
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Joint W-123 (ISO: ISO-456) has SS material but PMI test request not created
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/weldlog?id={id}`
|
||||
|
||||
**Action:** Create PMI test request in Weldlog module.
|
||||
|
||||
---
|
||||
|
||||
### 1️⃣7️⃣ NDT FN Test Missing
|
||||
|
||||
**When:** SS materials but FN (Ferrite) test request not created
|
||||
**Why:** Ferrite number testing required for stainless steel welds
|
||||
**Command:** `notifications:check-ndt-calculation`
|
||||
|
||||
**Condition:**
|
||||
```
|
||||
welding_date is filled
|
||||
AND (Material Grade 1 or 2 = SS (11, 8, 9))
|
||||
AND ferrite_request_no is empty
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Joint W-456 (ISO: ISO-789) has SS material but FN (Ferrite) test request not created
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/weldlog?id={id}`
|
||||
|
||||
**Action:** Create FN (Ferrite) test request in Weldlog module.
|
||||
|
||||
---
|
||||
|
||||
### 1️⃣8️⃣ Manage NDT Unnecessary Request
|
||||
|
||||
**When:** Manual NDT request created but NDE Matrix shows 0% ratio
|
||||
**Why:** Prevent unnecessary testing costs and time
|
||||
**Command:** `notifications:check-manage-ndt-unnecessary`
|
||||
|
||||
**Condition:**
|
||||
```
|
||||
welding_date is filled
|
||||
AND test_request_no is filled (RT/UT/PT/MT)
|
||||
AND (
|
||||
NDE Matrix ratio for that test type = 0% OR NULL
|
||||
OR NDE Matrix entry doesn't exist for line/joint type
|
||||
)
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Unnecessary RT test request for Joint W-987 (ISO: ISO-901, Line: ABC-123, Request: RT-000244)
|
||||
- NDE Matrix ratio is 0%
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/weldlog?id={id}`
|
||||
|
||||
**Action:**
|
||||
- Review NDE Matrix to verify if test is actually needed
|
||||
- If ratio should be > 0%, update NDE Matrix
|
||||
- If test is unnecessary, cancel the request in Manage NDT
|
||||
- This helps avoid wasting resources on unneeded tests
|
||||
|
||||
**Test Types Checked:**
|
||||
- RT (Radiographic Testing)
|
||||
- UT (Ultrasonic Testing)
|
||||
- PT (Penetrant Testing)
|
||||
- MT (Magnetic Testing)
|
||||
|
||||
---
|
||||
|
||||
### 1️⃣9️⃣ Support Log Missing in Weldlog
|
||||
|
||||
**When:** Support Log entry marked as welded but not found in Weldlog
|
||||
**Why:** Ensure all welded supports are properly recorded in Weldlog
|
||||
**Command:** `notifications:check-support-log-weldlog`
|
||||
|
||||
**Condition:**
|
||||
```
|
||||
Support Log weld_or_assembled_date is filled (not NULL, not empty, not 0000-00-00)
|
||||
AND support_code is not empty
|
||||
AND support_code NOT found in Weldlog (element_code_1 OR element_code_2)
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Support Code FE11-A-1028 (Line: ABC-123, Materials: Ст3пс, Weld Date: 2024-09-11) is welded
|
||||
in Support Log but not found in Weldlog (ID Code 1 or ID Code 2). Please add to Weldlog.
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/support?id={id}`
|
||||
|
||||
**Action:**
|
||||
- Verify if the support was actually welded
|
||||
- If welded, add the corresponding entry to Weldlog with the Support Code
|
||||
- If not welded yet, update Support Log status
|
||||
- This ensures accurate tracking of welded supports
|
||||
|
||||
**Fields Checked in Weldlog:**
|
||||
- `element_code_1` (ID Code 1)
|
||||
- `element_code_2` (ID Code 2)
|
||||
|
||||
---
|
||||
|
||||
### 2️⃣0️⃣ Paint System Missing
|
||||
|
||||
**When:** Paint System exists but customer-agreed paint values are missing
|
||||
**Why:** Complete paint specifications required for Line List entries
|
||||
**Command:** `notifications:check-paint-system-values`
|
||||
|
||||
**Condition:**
|
||||
```
|
||||
Paint System exists for paint_cycle
|
||||
AND (
|
||||
primer_coat_name_1 is empty OR
|
||||
brand_name_1 is empty OR
|
||||
thickness_1 is 0 or NULL
|
||||
)
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Paint System "А" (used by Lines: DEF-456, GHI-789...) has missing customer-agreed values:
|
||||
Primer Coat Name 1, Thickness 1. Please fill in Paint System details.
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/paint-system?id={id}`
|
||||
|
||||
**Action:**
|
||||
- Fill in the missing paint values in Paint System:
|
||||
- Primer Coat Name (Layer 1)
|
||||
- Brand Name (Layer 1)
|
||||
- Thickness (Layer 1)
|
||||
- These are customer-agreed values from Line List requirements
|
||||
|
||||
**Required Fields (Layer 1):**
|
||||
- `primer_coat_name_1`
|
||||
- `brand_name_1`
|
||||
- `thickness_1`
|
||||
|
||||
---
|
||||
|
||||
### 2️⃣1️⃣ Overall Repair Rate Exceeds 5%
|
||||
|
||||
**When:** Overall repair rate is too high (quality issue)
|
||||
**Why:** Alert QC teams when overall repair rate exceeds acceptable threshold
|
||||
**Command:** `notifications:check-daily-repair-rate`
|
||||
|
||||
**Calculation:**
|
||||
```
|
||||
Overall Repair Rate = (Total Repairs / Total Welds) × 100
|
||||
Alert if > 5%
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Overall repair rate is 6.8% (150 repairs out of 2200 welds).
|
||||
Please investigate quality issues.
|
||||
```
|
||||
|
||||
**Fix:** Investigate root cause - check welder qualifications, materials, procedures, and overall quality control processes.
|
||||
|
||||
---
|
||||
|
||||
### 2️⃣2️⃣ Weldlog Test Date Before Welding Date
|
||||
|
||||
**When:** Test date is recorded before welding date (logical error)
|
||||
**Why:** Tests cannot be performed before welding is completed
|
||||
**Command:** `notifications:check-weldlog-test-dates`
|
||||
|
||||
**Condition:**
|
||||
```
|
||||
welding_date is filled
|
||||
AND test_date (any test type) < welding_date
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
Weldlog joint W-789 (ISO: ISO-012) has test date (2025-12-05) before welding date (2025-12-10).
|
||||
Please verify dates.
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/weldlog?id={id}`
|
||||
|
||||
**Action:**
|
||||
- Verify and correct test dates
|
||||
- Ensure test dates are after welding date
|
||||
- Update test records with correct dates
|
||||
|
||||
---
|
||||
|
||||
### 2️⃣3️⃣ NDE Matrix Empty Row - NDT Assignment Required
|
||||
|
||||
**When:** NDE Matrix has empty rows without NDT assignments
|
||||
**Why:** All NDE Matrix rows must have proper NDT assignments
|
||||
**Command:** `notifications:check-nde-matrix-discrepancies`
|
||||
|
||||
**Condition:**
|
||||
```
|
||||
NDE Matrix row exists
|
||||
AND no NDT test assignments (RT, UT, PT, MT, etc.) are filled
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
NDE Matrix has empty row for Line ABC-123 (Project: P001, Joint Type: BW).
|
||||
NDT assignment required.
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/nde-matrix?line={line}`
|
||||
|
||||
**Action:**
|
||||
- Fill in appropriate NDT test assignments for the row
|
||||
- Ensure all required tests are assigned based on material and joint type
|
||||
|
||||
---
|
||||
|
||||
### 2️⃣4️⃣ NDT Request Overdue (10+ Days)
|
||||
|
||||
**When:** NDT test request created but not completed within 10 days
|
||||
**Why:** Ensure timely completion of NDT tests
|
||||
**Command:** `notifications:check-ndt-request-overdue`
|
||||
|
||||
**Condition:**
|
||||
```
|
||||
test_request_no is filled
|
||||
AND request_date is filled
|
||||
AND (test_date is empty OR test_date is NULL)
|
||||
AND request_date < (NOW() - 10 days)
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
NDT Request RT-000123 (Joint W-456, ISO: ISO-789) is overdue.
|
||||
Request date: 2025-11-25 (15 days ago). Please complete the test.
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/weldlog?id={id}`
|
||||
|
||||
**Action:**
|
||||
- Complete the NDT test and update test_date
|
||||
- If test is delayed, update request_date or cancel if unnecessary
|
||||
|
||||
---
|
||||
|
||||
### 2️⃣5️⃣-3️⃣3️⃣ Test Log PDF Reports Missing
|
||||
|
||||
**When:** Test completed but PDF report not uploaded
|
||||
**Why:** Documentation compliance - all test results must have PDF reports
|
||||
**Command:** `notifications:check-test-log-pdf`
|
||||
|
||||
**Test Types Checked:**
|
||||
- **VT (Visual Testing):** `v_t_logs` table → `report_file` field
|
||||
- **RT (Radiographic Testing):** `radiographic_tests` table → `report_file` field
|
||||
- **UT (Ultrasonic Testing):** `ultrasonic_tests` table → `report_file` field
|
||||
- **PT (Penetrant Testing):** `p_t_logs` table → `report_file` field
|
||||
- **MT (Magnetic Testing):** `magnetic_tests` table → `report_file` field
|
||||
- **HT (Hardness Testing):** `hardness_tests` table → `report_file` field
|
||||
- **PMI (Positive Material Identification):** `p_m_i_tests` table → `report_file` field
|
||||
- **PWHT (Post Weld Heat Treatment):** `p_w_h_t_s` table → `report_file` field
|
||||
- **Ferrite Testing:** `ferrits` table → `report_file` field
|
||||
|
||||
**Condition:**
|
||||
```
|
||||
Test result is filled (vt_result, rt_result, ut_result, etc.)
|
||||
AND report_file is empty or NULL
|
||||
```
|
||||
|
||||
**Message Example:**
|
||||
```
|
||||
VT Test for Joint W-123 (ISO: ISO-456) is completed but PDF report is missing.
|
||||
Please upload test report.
|
||||
```
|
||||
|
||||
**Link:** `/admin/types/{test-type}?id={id}`
|
||||
|
||||
**Action:** Upload the PDF test report in the respective test log module.
|
||||
|
||||
---
|
||||
|
||||
## ⏰ Schedule Overview
|
||||
|
||||
**New System (v4):** All notification checks run **every 5 minutes**.
|
||||
|
||||
**Features:**
|
||||
- ✅ Real-time notifications (maximum 5 minutes delay)
|
||||
- ✅ First run scans entire table
|
||||
- ✅ Subsequent runs check only new records
|
||||
- ✅ No duplicate notifications
|
||||
- ✅ 90%+ performance improvement
|
||||
|
||||
**All Commands:**
|
||||
- `notifications:check-deleted-joints` - Every 5 minutes
|
||||
- `notifications:check-repair-log-new-joint` - Every 5 minutes
|
||||
- `notifications:check-daily-repair-rate` - Every 5 minutes
|
||||
- `notifications:check-line-list-missing-data` - Every 5 minutes
|
||||
- `notifications:check-pdf-documents` - Every 5 minutes
|
||||
- `notifications:check-weldlog-certificate` - Every 5 minutes
|
||||
- `notifications:check-incoming-control-certificate` - Every 5 minutes
|
||||
- `notifications:check-nde-matrix-discrepancies` - Every 5 minutes
|
||||
- `notifications:check-ndt-calculation` - Every 5 minutes
|
||||
- `notifications:check-manage-ndt-unnecessary` - Every 5 minutes
|
||||
- `notifications:check-support-log-weldlog` - Every 5 minutes
|
||||
- `notifications:check-paint-system-values` - Every 5 minutes
|
||||
- `notifications:check-weldlog-test-dates` - Every 5 minutes
|
||||
- `notifications:check-ndt-request-overdue` - Every 5 minutes
|
||||
- `notifications:check-test-log-pdf` - Every 5 minutes
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Troubleshooting
|
||||
|
||||
### No Notifications Received?
|
||||
|
||||
1. **Check Role Assignment:**
|
||||
```
|
||||
Settings → Specific Permissions → Notification Settings
|
||||
Verify your role is assigned to the notification type
|
||||
```
|
||||
|
||||
2. **Check Scheduler:**
|
||||
```bash
|
||||
# Verify cron is running
|
||||
ps aux | grep schedule:run
|
||||
|
||||
# Check Notification logs
|
||||
tail -f storage/logs/notifications-YYYY-MM-DD.log
|
||||
```
|
||||
|
||||
3. **Check Data:**
|
||||
```bash
|
||||
# Manually run command to see results
|
||||
php artisan notifications:check-deleted-joints
|
||||
# Should output: "Sent X notifications..."
|
||||
```
|
||||
|
||||
### Notifications Not Clearing?
|
||||
|
||||
- Click on notification to mark as read
|
||||
- Use "Mark All as Read" button in dropdown
|
||||
- Visit `/admin/types/my-notifications` for bulk actions
|
||||
|
||||
### Duplicate Notifications?
|
||||
|
||||
- ✅ **No duplicate notifications in new system**
|
||||
- System won't send duplicate notifications for the same issue
|
||||
- When new records are added, notification is updated (additive approach)
|
||||
- When issue is resolved, notification automatically stops
|
||||
|
||||
---
|
||||
|
||||
## 📊 Database Schema
|
||||
|
||||
### notifications table
|
||||
```sql
|
||||
- id (primary key)
|
||||
- user_id (foreign key → users)
|
||||
- code (notification type code)
|
||||
- title
|
||||
- message
|
||||
- link (URL to relevant page)
|
||||
- is_read (boolean)
|
||||
- created_at
|
||||
- updated_at
|
||||
```
|
||||
|
||||
### Indexes
|
||||
```sql
|
||||
- user_id
|
||||
- is_read
|
||||
- created_at
|
||||
- code
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔗 Related Files
|
||||
|
||||
**Helper Functions:**
|
||||
- `app/Functions/notification-state-helper.php` - State tracking functions
|
||||
- `app/Functions/notification-helper.php` - Notification sending functions
|
||||
|
||||
**Commands (All updated for v4):**
|
||||
- `app/Console/Commands/NotificationCheckDeletedJoints.php`
|
||||
- `app/Console/Commands/NotificationCheckRepairLog.php`
|
||||
- `app/Console/Commands/NotificationCheckRepairRate.php`
|
||||
- `app/Console/Commands/NotificationCheckLineList.php`
|
||||
- `app/Console/Commands/NotificationCheckPDFDocuments.php`
|
||||
- `app/Console/Commands/NotificationCheckWeldlogCertificate.php`
|
||||
- `app/Console/Commands/NotificationCheckIncomingControlCertificate.php`
|
||||
- `app/Console/Commands/NotificationCheckNDEMatrixDiscrepancies.php`
|
||||
- `app/Console/Commands/NotificationCheckNDTCalculation.php`
|
||||
- `app/Console/Commands/NotificationCheckManageNDT.php`
|
||||
- `app/Console/Commands/NotificationCheckSupportLogWeldlog.php`
|
||||
- `app/Console/Commands/NotificationCheckPaintSystem.php`
|
||||
- `app/Console/Commands/NotificationCheckWeldlogTestDates.php`
|
||||
- `app/Console/Commands/NotificationCheckNDTRequestOverdue.php`
|
||||
- `app/Console/Commands/NotificationCheckTestLogPDF.php`
|
||||
|
||||
**Schedule:**
|
||||
- `app/Console/Kernel.php` - All commands run every 5 minutes
|
||||
|
||||
**Documentation:**
|
||||
- `notification-testing-guide.md` - Testing guide (detailed test scenarios)
|
||||
|
||||
**Controllers:**
|
||||
- `app/Http/Controllers/NotificationController.php`
|
||||
- `app/Http/Controllers/AdminController.php` (line 1236-1244 for Welder ID Card)
|
||||
|
||||
**Views:**
|
||||
- `resources/views/admin/master.blade.php` (Bell icon UI)
|
||||
- `resources/views/admin/type/my-notifications.blade.php` (Full page)
|
||||
|
||||
**Config:**
|
||||
- `app/Console/Kernel.php` (Scheduler registration)
|
||||
- `resources/views/admin/type/settings/specific-permissions.blade.php` (Permissions)
|
||||
|
||||
---
|
||||
|
||||
## 📝 Notes
|
||||
|
||||
- All notification messages are in **English**
|
||||
- Notifications are **user-specific** based on role assignments
|
||||
- Notification polling happens **every 60 seconds** in frontend
|
||||
- Commands include **performance limits** (typically 50-100 records per run)
|
||||
- **Caching** is used for unread counts to optimize performance
|
||||
|
||||
---
|
||||
|
||||
## 🆘 Support
|
||||
|
||||
For technical support or questions:
|
||||
1. Check Laravel logs: `storage/logs/truncgil-**-**.log`
|
||||
2. Review command output for specific errors
|
||||
3. Verify database connectivity and queue worker status
|
||||
4. Contact system administrator for permission issues
|
||||
|
||||
---
|
||||
|
||||
**End of Guide**
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
# Paint Follow-up User Guide
|
||||
|
||||
## What is the Paint Follow-up Module?
|
||||
|
||||
The Paint Follow-up module manages paint follow-up activities and quality control. This module helps track paint application follow-up, manage quality control, and ensure proper paint follow-up documentation and compliance.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Paint Follow-up:
|
||||
1. Login to the system
|
||||
2. Click on **QC** in the main menu
|
||||
3. Select **Paint Follow-up** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Follow-up Management**: Manage paint follow-up activities
|
||||
- **Quality Control**: Control paint quality and standards
|
||||
- **Activity Tracking**: Track follow-up activities
|
||||
- **Documentation**: Maintain follow-up documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate follow-up reports
|
||||
- **Data Analysis**: Analyze follow-up data and trends
|
||||
- **Export Options**: Export follow-up data in various formats
|
||||
- **Compliance Monitoring**: Monitor follow-up compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing Paint Follow-up
|
||||
1. Click **"Manage Follow-up"** button
|
||||
2. Select follow-up activity for management
|
||||
3. Review paint quality control
|
||||
4. Update follow-up information
|
||||
5. Track quality standards
|
||||
6. Generate follow-up reports
|
||||
7. Monitor compliance
|
||||
|
||||
### Follow-up Management
|
||||
1. Review follow-up activities
|
||||
2. Update quality control information
|
||||
3. Track quality standards
|
||||
4. Monitor compliance
|
||||
5. Generate follow-up reports
|
||||
|
||||
### Follow-up Categories
|
||||
- **Quality Control**: Paint quality control activities
|
||||
- **Follow-up Activities**: Paint follow-up activities
|
||||
- **Quality Standards**: Paint quality standards
|
||||
- **Compliance Tracking**: Follow-up compliance tracking
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Follow paint follow-up procedures accurately
|
||||
- ✅ Monitor quality standards regularly
|
||||
- ✅ Maintain proper documentation
|
||||
- ✅ Ensure compliance with standards
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify follow-up process accuracy
|
||||
- ✅ Ensure proper quality standards
|
||||
- ✅ Monitor follow-up management effectiveness
|
||||
- ✅ Regular review of follow-up processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Quality issues**: Check paint quality control procedures
|
||||
2. **Follow-up delays**: Review follow-up scheduling
|
||||
3. **Compliance problems**: Verify compliance requirements
|
||||
|
||||
### Getting Help
|
||||
- Contact the QC department for technical support
|
||||
- Consult paint follow-up procedures and guidelines
|
||||
- Check follow-up activities and compliance status
|
||||
@@ -1,74 +0,0 @@
|
||||
# Paint Matrix User Guide
|
||||
|
||||
## What is the Paint Matrix Module?
|
||||
|
||||
The Paint Matrix module manages paint system specifications and requirements for various materials and applications. This module helps define paint requirements, track paint systems, and ensure proper paint application procedures.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Paint Matrix:
|
||||
1. Login to the system
|
||||
2. Click on **QC** in the main menu
|
||||
3. Select **Paint Matrix** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Matrix Management**: Manage paint system requirements matrix
|
||||
- **System Definition**: Define paint systems and specifications
|
||||
- **Requirement Tracking**: Track paint requirements for materials
|
||||
- **Compliance Monitoring**: Monitor paint compliance and standards
|
||||
|
||||
### Secondary Functions
|
||||
- **Template Management**: Use pre-built paint matrix templates
|
||||
- **Documentation**: Maintain paint matrix documentation
|
||||
- **Report Generation**: Generate paint matrix reports
|
||||
- **Version Control**: Track matrix versions and updates
|
||||
|
||||
## How to Use
|
||||
|
||||
### Creating Paint Matrix
|
||||
1. Click **"New Paint Matrix"** button
|
||||
2. Select material type and application
|
||||
3. Define paint system requirements
|
||||
4. Set application criteria and standards
|
||||
5. Assign responsible personnel
|
||||
6. Save matrix configuration
|
||||
|
||||
### Matrix Management
|
||||
1. Review paint requirements and specifications
|
||||
2. Update matrix as requirements change
|
||||
3. Track matrix compliance and effectiveness
|
||||
4. Generate matrix reports and analytics
|
||||
|
||||
### Matrix Categories
|
||||
- **Material Types**: Different material paint requirements
|
||||
- **Application Types**: Application-specific paint requirements
|
||||
- **Environment Types**: Environment-specific paint requirements
|
||||
- **Standard Types**: Standard-based paint requirements
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Define clear paint requirements and criteria
|
||||
- ✅ Follow established paint standards and procedures
|
||||
- ✅ Monitor matrix compliance and effectiveness
|
||||
- ✅ Update matrix as requirements change
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify matrix accuracy and completeness
|
||||
- ✅ Ensure compliance with paint standards
|
||||
- ✅ Monitor matrix effectiveness and results
|
||||
- ✅ Regular review of matrix requirements
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Matrix not saving**: Check all required fields are completed
|
||||
2. **Compliance issues**: Review paint standards and requirements
|
||||
3. **System conflicts**: Contact paint supervisor for resolution
|
||||
|
||||
### Getting Help
|
||||
- Contact the QC department for technical support
|
||||
- Consult paint standards and procedures
|
||||
- Check matrix compliance and requirements
|
||||
@@ -1,76 +0,0 @@
|
||||
# Paint System User Guide
|
||||
|
||||
## What is the Paint System Module?
|
||||
|
||||
The Paint System module manages paint system operations and procedures. This module helps track paint system activities, manage paint procedures, and ensure proper paint system documentation and quality control.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Paint System:
|
||||
1. Login to the system
|
||||
2. Click on **QC** in the main menu
|
||||
3. Select **Paint System** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **System Management**: Manage paint system operations
|
||||
- **Procedure Tracking**: Track paint procedures
|
||||
- **Quality Control**: Manage paint quality control
|
||||
- **Documentation**: Maintain system documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate system reports
|
||||
- **Data Analysis**: Analyze system data and trends
|
||||
- **Export Options**: Export system data in various formats
|
||||
- **Compliance Monitoring**: Monitor system compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing Paint System
|
||||
1. Click **"Manage System"** button
|
||||
2. Select paint system for management
|
||||
3. Review paint procedures
|
||||
4. Update system information
|
||||
5. Track quality control
|
||||
6. Generate system reports
|
||||
7. Monitor compliance
|
||||
|
||||
### System Management
|
||||
1. Review paint system operations
|
||||
2. Update paint procedures
|
||||
3. Track quality control
|
||||
4. Monitor compliance
|
||||
5. Generate system reports
|
||||
|
||||
### System Categories
|
||||
- **Paint Operations**: Paint system operations
|
||||
- **Quality Control**: Paint quality control
|
||||
- **Procedure Management**: Paint procedure management
|
||||
- **Compliance Tracking**: System compliance tracking
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Follow paint system procedures accurately
|
||||
- ✅ Monitor quality control regularly
|
||||
- ✅ Maintain proper documentation
|
||||
- ✅ Ensure compliance with standards
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify paint system procedure accuracy
|
||||
- ✅ Ensure proper quality control
|
||||
- ✅ Monitor system management effectiveness
|
||||
- ✅ Regular review of system processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **System errors**: Check paint system procedures and equipment
|
||||
2. **Quality issues**: Review quality control procedures
|
||||
3. **Compliance problems**: Verify compliance requirements
|
||||
|
||||
### Getting Help
|
||||
- Contact the QC department for technical support
|
||||
- Consult paint system procedures and guidelines
|
||||
- Check paint system equipment and compliance status
|
||||
@@ -1,76 +0,0 @@
|
||||
# Paint User Guide
|
||||
|
||||
## What is the Paint Module?
|
||||
|
||||
The Paint module manages paint operations and quality control. This module helps track paint activities, manage paint procedures, and ensure proper paint documentation and quality control.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Paint:
|
||||
1. Login to the system
|
||||
2. Click on **QC** in the main menu
|
||||
3. Select **Paint** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Paint Management**: Manage paint operations
|
||||
- **Quality Control**: Manage paint quality control
|
||||
- **Procedure Tracking**: Track paint procedures
|
||||
- **Documentation**: Maintain paint documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate paint reports
|
||||
- **Data Analysis**: Analyze paint data and trends
|
||||
- **Export Options**: Export paint data in various formats
|
||||
- **Compliance Monitoring**: Monitor paint compliance
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing Paint Operations
|
||||
1. Click **"Manage Paint"** button
|
||||
2. Select paint operation for management
|
||||
3. Review paint procedures
|
||||
4. Update paint information
|
||||
5. Track quality control
|
||||
6. Generate paint reports
|
||||
7. Monitor compliance
|
||||
|
||||
### Paint Management
|
||||
1. Review paint operations
|
||||
2. Update paint procedures
|
||||
3. Track quality control
|
||||
4. Monitor compliance
|
||||
5. Generate paint reports
|
||||
|
||||
### Paint Categories
|
||||
- **Paint Operations**: Paint operation management
|
||||
- **Quality Control**: Paint quality control
|
||||
- **Procedure Management**: Paint procedure management
|
||||
- **Compliance Tracking**: Paint compliance tracking
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Follow paint procedures accurately
|
||||
- ✅ Monitor quality control regularly
|
||||
- ✅ Maintain proper documentation
|
||||
- ✅ Ensure compliance with standards
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify paint procedure accuracy
|
||||
- ✅ Ensure proper quality control
|
||||
- ✅ Monitor paint management effectiveness
|
||||
- ✅ Regular review of paint processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Paint errors**: Check paint procedures and equipment
|
||||
2. **Quality issues**: Review quality control procedures
|
||||
3. **Compliance problems**: Verify compliance requirements
|
||||
|
||||
### Getting Help
|
||||
- Contact the QC department for technical support
|
||||
- Consult paint procedures and guidelines
|
||||
- Check paint equipment and compliance status
|
||||
@@ -1,76 +0,0 @@
|
||||
# PDF Editor User Guide
|
||||
|
||||
## What is the PDF Editor Module?
|
||||
|
||||
The PDF Editor module provides tools for editing and modifying PDF documents. This module helps edit PDF content, add annotations, modify text, and ensure proper PDF document editing capabilities.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access PDF Editor:
|
||||
1. Login to the system
|
||||
2. Click on **Settings** in the main menu
|
||||
3. Select **PDF Editor** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **PDF Editing**: Edit PDF document content
|
||||
- **Text Modification**: Modify text in PDF documents
|
||||
- **Annotation Tools**: Add annotations and comments
|
||||
- **Document Management**: Manage PDF documents
|
||||
|
||||
### Secondary Functions
|
||||
- **Form Filling**: Fill PDF forms
|
||||
- **Document Conversion**: Convert PDF to other formats
|
||||
- **Quality Control**: Control editing quality
|
||||
- **Version Control**: Manage document versions
|
||||
|
||||
## How to Use
|
||||
|
||||
### Editing PDF Documents
|
||||
1. Click **"Edit PDF"** button
|
||||
2. Select PDF document for editing
|
||||
3. Choose editing tools and options
|
||||
4. Make required modifications
|
||||
5. Add annotations if needed
|
||||
6. Save edited document
|
||||
7. Export or distribute document
|
||||
|
||||
### PDF Management
|
||||
1. Review PDF document
|
||||
2. Select editing tools
|
||||
3. Make document modifications
|
||||
4. Add annotations and comments
|
||||
5. Save and distribute documents
|
||||
|
||||
### Editing Categories
|
||||
- **Text Editing**: Text modification and editing
|
||||
- **Annotation Tools**: Adding comments and annotations
|
||||
- **Form Filling**: Filling PDF forms
|
||||
- **Document Conversion**: Converting PDF formats
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Use appropriate editing tools
|
||||
- ✅ Maintain document quality
|
||||
- ✅ Save changes regularly
|
||||
- ✅ Test edited documents before distribution
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify editing accuracy
|
||||
- ✅ Ensure proper document formatting
|
||||
- ✅ Monitor editing effectiveness
|
||||
- ✅ Regular review of editing processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **PDF not opening**: Check file format and permissions
|
||||
2. **Editing not working**: Verify editing permissions
|
||||
3. **Save problems**: Check file permissions and storage
|
||||
|
||||
### Getting Help
|
||||
- Contact the Settings department for technical support
|
||||
- Consult PDF editor procedures and guidelines
|
||||
- Check document permissions and system status
|
||||
@@ -1,76 +0,0 @@
|
||||
# PDF File Generator User Guide
|
||||
|
||||
## What is the PDF File Generator Module?
|
||||
|
||||
The PDF File Generator module provides tools for generating PDF files from various data sources and documents. This module helps convert documents to PDF format, create PDF reports, and ensure proper PDF file generation and management.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access PDF File Generator:
|
||||
1. Login to the system
|
||||
2. Click on **Settings** in the main menu
|
||||
3. Select **PDF File Generator** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **PDF Generation**: Generate PDF files from documents
|
||||
- **Format Conversion**: Convert various formats to PDF
|
||||
- **Report Generation**: Generate PDF reports
|
||||
- **Document Management**: Manage PDF documents
|
||||
|
||||
### Secondary Functions
|
||||
- **Template Integration**: Integrate with document templates
|
||||
- **Batch Processing**: Process multiple files in batch
|
||||
- **Quality Control**: Control PDF quality and settings
|
||||
- **Distribution**: Distribute generated PDF files
|
||||
|
||||
## How to Use
|
||||
|
||||
### Generating PDF Files
|
||||
1. Click **"Generate PDF"** button
|
||||
2. Select document or data source
|
||||
3. Choose PDF settings and options
|
||||
4. Configure output format
|
||||
5. Set quality parameters
|
||||
6. Generate PDF file
|
||||
7. Download or distribute PDF
|
||||
|
||||
### PDF Management
|
||||
1. Review document requirements
|
||||
2. Select appropriate data sources
|
||||
3. Configure PDF settings
|
||||
4. Generate PDF files
|
||||
5. Distribute PDF documents
|
||||
|
||||
### PDF Categories
|
||||
- **Document PDFs**: Document conversions
|
||||
- **Report PDFs**: Report generation
|
||||
- **Form PDFs**: Form conversions
|
||||
- **Custom PDFs**: Custom PDF generation
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Select appropriate PDF settings
|
||||
- ✅ Ensure document quality
|
||||
- ✅ Configure proper output format
|
||||
- ✅ Test PDF generation before distribution
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify PDF quality and formatting
|
||||
- ✅ Ensure proper file generation
|
||||
- ✅ Monitor PDF generation effectiveness
|
||||
- ✅ Regular review of PDF processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **PDF not generating**: Check document format and permissions
|
||||
2. **Quality issues**: Review PDF settings and parameters
|
||||
3. **File size problems**: Check compression and quality settings
|
||||
|
||||
### Getting Help
|
||||
- Contact the Settings department for technical support
|
||||
- Consult PDF file generator procedures and guidelines
|
||||
- Check document format and system status
|
||||
@@ -1,129 +0,0 @@
|
||||
# PDF Upload ve Senkronizasyon Entegrasyon Rehberi / PDF Upload and Synchronization Integration Guide
|
||||
|
||||
Bu rehber, herhangi bir modüle PDF dosya yükleme özelliği ve otomatik veritabanı eşleştirme (sync) altyapısının nasıl ekleneceğini açıklar.
|
||||
This guide explains how to add PDF file upload functionality and automatic database synchronization infrastructure to any module.
|
||||
|
||||
## Genel Bakış / Overview
|
||||
|
||||
Sistem, yüklenen PDF dosyalarını isimlendirme kurallarına göre veritabanındaki kayıtlarla otomatik olarak eşleştirir. İşlem 4 ana adımdan oluşur:
|
||||
The system automatically matches uploaded PDF files with database records based on naming conventions. The process consists of 4 main steps:
|
||||
|
||||
1. **Database Migration**: `download` sütununun eklenmesi.
|
||||
2. **Module View**: Arayüze yükleme butonu ve indirme linkinin eklenmesi.
|
||||
3. **Upload Handler**: Dosya yüklendiğinde çalışacak tetikleyicinin (trigger) tanımlanması.
|
||||
4. **Sync Script**: Dosya adı ile veritabanı kaydını eşleştiren mantığın kurulması.
|
||||
|
||||
---
|
||||
|
||||
## Adım 1: Veritabanı Migration / Database Migration
|
||||
|
||||
İlgili modülün tablosuna `download` sütunu eklenmelidir.
|
||||
Add a `download` column to the module's table.
|
||||
|
||||
```bash
|
||||
php artisan make:migration add_download_to_itps_table --table=i_t_p_s
|
||||
```
|
||||
|
||||
```php
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('i_t_p_s', function (Blueprint $table) {
|
||||
$table->string('download')->nullable();
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
## Adım 2: Modül Arayüzü / Module View
|
||||
|
||||
`resources/views/admin/type/{module}.blade.php` dosyasını düzenleyin.
|
||||
Edit the module's blade file.
|
||||
|
||||
### a. Sütun Tanımı / Column Definition
|
||||
`$relationDatas` dizisine `download` alanını ekleyin.
|
||||
Add the `download` field to `$relationDatas`.
|
||||
|
||||
```php
|
||||
$relationDatas = [
|
||||
'download' => [
|
||||
'type' => 'link-search',
|
||||
'html' => '<i class="fa fa-pdf"></i>'
|
||||
],
|
||||
// ...
|
||||
];
|
||||
```
|
||||
|
||||
### b. Blok Grubu / Block Group
|
||||
`$blockGroup` dizisinde uygun yere (genellikle 'General Info') ekleyin.
|
||||
Add to `$blockGroup` array.
|
||||
|
||||
### c. Yükleme Ayarları / Upload Configuration
|
||||
Dosyanın en altına, PHP bloğunun içine yükleme ayarlarını ekleyin.
|
||||
Add upload settings inside the PHP block.
|
||||
|
||||
```php
|
||||
$firstUploadFolder = '004_QA/000_ITP/'; // Hedef klasör / Target folder
|
||||
$firstUploadTitle = 'Upload PDF';
|
||||
$uploadPermissionKey = 'itp_upload_permission';
|
||||
```
|
||||
|
||||
### d. Include Upload Component
|
||||
Sayfanın HTML kısmına upload bileşenini dahil edin.
|
||||
Include the upload component in the HTML section.
|
||||
|
||||
```php
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
@include("admin.type.document.upload") <!-- Add this line -->
|
||||
@include("components.blocks.module-block")
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Adım 3: Yükleme İşleyicisi / Upload Handler
|
||||
|
||||
`resources/views/admin-ajax/document-upload.blade.php` dosyasını açın ve modülünüz için bir koşul ekleyin.
|
||||
Open `document-upload.blade.php` and add a condition for your module.
|
||||
|
||||
```php
|
||||
if ($tableName == "i_t_p_s") { // Tablo adı / Table name
|
||||
?>
|
||||
@include("cron.pdf-db-itp-sync", [
|
||||
"fileName" => $onlyFileName
|
||||
])
|
||||
<?php
|
||||
}
|
||||
```
|
||||
|
||||
## Adım 4: Senkronizasyon Betiği / Sync Script
|
||||
|
||||
`resources/views/cron/pdf-db-{module}-sync.blade.php` dosyasını oluşturun. Bu dosya eşleştirme mantığını içerir.
|
||||
Create the sync script file. This file contains the matching logic.
|
||||
|
||||
**Örnek / Example (ITP):**
|
||||
|
||||
```php
|
||||
<?php
|
||||
$table = "i_t_p_s";
|
||||
$mainPath = "004_QA/000_ITP";
|
||||
$nullDownload = db($table);
|
||||
|
||||
// Tek dosya yüklendiğinde filtreleme / Filtering when single file uploaded
|
||||
if(isset($fileName)) {
|
||||
// Eşleşecek sütun (örn: itp_no) / Matching column (e.g. itp_no)
|
||||
$nullDownload = $nullDownload->where("itp_no", $fileName);
|
||||
$commitSize = 1;
|
||||
}
|
||||
|
||||
$nullDownload = $nullDownload->get();
|
||||
|
||||
DB::beginTransaction();
|
||||
// ... (Standart döngü ve update işlemi / Standard loop and update process)
|
||||
// Detaylar için mevcut sync dosyalarına bakınız / See existing sync files for details
|
||||
?>
|
||||
```
|
||||
|
||||
## İpuçları / Tips
|
||||
|
||||
- **Wildcard Matching**: Dosya adlarında `/` veya boşluk gibi karakterler farklılık gösterebilir. Sync scriptinde `str_replace` kullanarak bunları `*` ile değiştirmek eşleştirme başarısını artırır.
|
||||
- **Permission**: `uploadPermissionKey` tanımlamayı unutmayın, aksi halde yetki hatası alabilirsiniz.
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
# PMI Log User Guide
|
||||
|
||||
## What is the PMI Log Module?
|
||||
|
||||
The PMI Log module tracks and documents Positive Material Identification (PMI) testing activities and results. This module helps ensure proper material identification, monitor PMI testing quality, and maintain quality control records for various project components.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access PMI Log:
|
||||
1. Login to the system
|
||||
2. Click on **NDT** in the main menu
|
||||
3. Select **PMI Log** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **PMI Testing Logging**: Record PMI testing activities and results
|
||||
- **Quality Control**: Monitor PMI testing compliance and standards
|
||||
- **Data Analysis**: Analyze PMI testing trends and patterns
|
||||
- **Report Generation**: Generate PMI testing reports
|
||||
|
||||
### Secondary Functions
|
||||
- **Equipment Management**: Track PMI equipment calibration and maintenance
|
||||
- **Operator Management**: Manage qualified PMI testing operators
|
||||
- **Documentation**: Maintain PMI testing records and procedures
|
||||
- **Alert System**: Alert when material composition is out of specification
|
||||
|
||||
## How to Use
|
||||
|
||||
### Recording PMI Tests
|
||||
1. Click **"New PMI Test"** button
|
||||
2. Select the material or component to test
|
||||
3. Choose PMI testing method and technique
|
||||
4. Enter test conditions and parameters
|
||||
5. Record test results and findings
|
||||
6. Add test observations and comments
|
||||
7. Save test record
|
||||
|
||||
### Quality Control Process
|
||||
1. Review PMI testing specifications
|
||||
2. Verify equipment calibration status
|
||||
3. Check operator qualifications
|
||||
4. Monitor testing accuracy and repeatability
|
||||
5. Document any deviations or issues
|
||||
6. Take corrective action if needed
|
||||
|
||||
### Testing Categories
|
||||
- **Base Materials**: PMI testing of base materials
|
||||
- **Welded Joints**: PMI testing of welded joints
|
||||
- **Components**: PMI testing of various components
|
||||
- **Special Applications**: Critical PMI testing requirements
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Always calibrate equipment before testing
|
||||
- ✅ Follow proper PMI testing procedures and standards
|
||||
- ✅ Document test conditions accurately
|
||||
- ✅ Verify operator qualifications
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Check equipment calibration regularly
|
||||
- ✅ Verify testing accuracy and repeatability
|
||||
- ✅ Monitor PMI testing trends and patterns
|
||||
- ✅ Document any testing issues or deviations
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Testing errors**: Check equipment calibration and procedure
|
||||
2. **Material composition issues**: Review material specifications
|
||||
3. **Equipment malfunction**: Contact equipment maintenance
|
||||
|
||||
### Getting Help
|
||||
- Contact the NDT department for technical support
|
||||
- Consult PMI testing procedures and standards
|
||||
- Check equipment calibration records
|
||||
@@ -1,76 +0,0 @@
|
||||
# PQR User Guide
|
||||
|
||||
## What is the PQR Module?
|
||||
|
||||
The PQR (Procedure Qualification Record) module manages welding procedure qualification records and documentation. This module helps track PQR records, manage qualification procedures, and ensure proper PQR documentation and compliance.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access PQR:
|
||||
1. Login to the system
|
||||
2. Click on **Welding** in the main menu
|
||||
3. Select **PQR** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **PQR Management**: Manage procedure qualification records
|
||||
- **Qualification Tracking**: Track qualification procedures
|
||||
- **Documentation**: Maintain PQR documentation
|
||||
- **Compliance Monitoring**: Monitor PQR compliance
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate PQR reports
|
||||
- **Data Analysis**: Analyze PQR data and trends
|
||||
- **Export Options**: Export PQR data in various formats
|
||||
- **Version Control**: Manage PQR versions
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing PQR Records
|
||||
1. Click **"Manage PQR"** button
|
||||
2. Select PQR for management
|
||||
3. Review qualification records
|
||||
4. Update PQR information
|
||||
5. Track qualification status
|
||||
6. Generate PQR reports
|
||||
7. Monitor compliance
|
||||
|
||||
### PQR Management
|
||||
1. Review PQR records
|
||||
2. Update qualification information
|
||||
3. Track qualification status
|
||||
4. Monitor compliance
|
||||
5. Generate PQR reports
|
||||
|
||||
### PQR Categories
|
||||
- **Qualified Procedures**: Qualified welding procedures
|
||||
- **Pending Qualifications**: Pending qualification procedures
|
||||
- **Expired Qualifications**: Expired qualification records
|
||||
- **Special Procedures**: Special qualification procedures
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Keep PQR records current and accurate
|
||||
- ✅ Monitor qualification expiration dates
|
||||
- ✅ Maintain proper documentation
|
||||
- ✅ Ensure compliance with standards
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify PQR accuracy and completeness
|
||||
- ✅ Ensure proper qualification procedures
|
||||
- ✅ Monitor PQR management effectiveness
|
||||
- ✅ Regular review of PQR processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Qualification expired**: Check qualification dates and renewal
|
||||
2. **Documentation issues**: Review PQR documentation requirements
|
||||
3. **Compliance problems**: Verify compliance requirements
|
||||
|
||||
### Getting Help
|
||||
- Contact the Welding department for technical support
|
||||
- Consult PQR procedures and guidelines
|
||||
- Check PQR qualification and compliance status
|
||||
@@ -1,76 +0,0 @@
|
||||
# Predefined Variables User Guide
|
||||
|
||||
## What is the Predefined Variables Module?
|
||||
|
||||
The Predefined Variables module manages system-wide predefined variables and constants. This module helps track variable definitions, manage variable values, and ensure proper variable management and documentation.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To access Predefined Variables:
|
||||
1. Login to the system
|
||||
2. Click on **Settings** in the main menu
|
||||
3. Select **Predefined Variables** from the submenu
|
||||
|
||||
## Key Features
|
||||
|
||||
### Primary Functions
|
||||
- **Variable Management**: Manage predefined variables
|
||||
- **Value Tracking**: Track variable values
|
||||
- **Definition Management**: Manage variable definitions
|
||||
- **Documentation**: Maintain variable documentation
|
||||
|
||||
### Secondary Functions
|
||||
- **Report Generation**: Generate variable reports
|
||||
- **Data Analysis**: Analyze variable data and trends
|
||||
- **Export Options**: Export variable data in various formats
|
||||
- **Validation Tools**: Validate variable values
|
||||
|
||||
## How to Use
|
||||
|
||||
### Managing Predefined Variables
|
||||
1. Click **"Manage Variables"** button
|
||||
2. Select variable for management
|
||||
3. Review variable definition
|
||||
4. Update variable value
|
||||
5. Track variable usage
|
||||
6. Generate variable reports
|
||||
7. Monitor variable status
|
||||
|
||||
### Variable Management
|
||||
1. Review variable definitions
|
||||
2. Update variable values
|
||||
3. Track variable usage
|
||||
4. Monitor variable status
|
||||
5. Generate variable reports
|
||||
|
||||
### Variable Categories
|
||||
- **System Variables**: System-wide variables
|
||||
- **User Variables**: User-defined variables
|
||||
- **Configuration Variables**: Configuration variables
|
||||
- **Custom Variables**: Custom variable definitions
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Usage Guidelines
|
||||
- ✅ Keep variable definitions current and accurate
|
||||
- ✅ Monitor variable values regularly
|
||||
- ✅ Maintain proper documentation
|
||||
- ✅ Validate variable values
|
||||
|
||||
### Quality Assurance
|
||||
- ✅ Verify variable definition accuracy
|
||||
- ✅ Ensure proper variable management
|
||||
- ✅ Monitor variable management effectiveness
|
||||
- ✅ Regular review of variable processes
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Variable not saving**: Check all required fields are completed
|
||||
2. **Value errors**: Verify variable value format
|
||||
3. **Definition problems**: Review variable definition requirements
|
||||
|
||||
### Getting Help
|
||||
- Contact the Settings department for technical support
|
||||
- Consult predefined variables procedures and guidelines
|
||||
- Check variable definitions and system status
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user