sdvsdv
This commit is contained in:
@@ -765,4 +765,229 @@ Sistem ini memungkinkan:
|
|||||||
4. Pemantauan progress analisis secara real-time
|
4. Pemantauan progress analisis secara real-time
|
||||||
5. Pelaporan yang komprehensif untuk pelanggan
|
5. Pelaporan yang komprehensif untuk pelanggan
|
||||||
|
|
||||||
|
### Manajemen Penjadwalan Sampling
|
||||||
|
|
||||||
|
#### 1. Struktur Database untuk Penjadwalan
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Tabel untuk jadwal sampling
|
||||||
|
CREATE TABLE sampling_schedules (
|
||||||
|
schedule_id SERIAL PRIMARY KEY,
|
||||||
|
date DATE,
|
||||||
|
time_slot VARCHAR(20), -- 'PAGI', 'SIANG', 'SORE'
|
||||||
|
status VARCHAR(50), -- 'AVAILABLE', 'BOOKED', 'COMPLETED'
|
||||||
|
created_at TIMESTAMP,
|
||||||
|
updated_at TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Tabel untuk detail booking jadwal
|
||||||
|
CREATE TABLE sampling_bookings (
|
||||||
|
booking_id SERIAL PRIMARY KEY,
|
||||||
|
schedule_id INT,
|
||||||
|
request_id INT, -- Link ke service_requests
|
||||||
|
customer_id INT,
|
||||||
|
project_name VARCHAR(200),
|
||||||
|
location TEXT,
|
||||||
|
sampling_type VARCHAR(50),
|
||||||
|
assigned_team_id INT,
|
||||||
|
status VARCHAR(50), -- 'SCHEDULED', 'IN_PROGRESS', 'COMPLETED', 'CANCELLED'
|
||||||
|
notes TEXT,
|
||||||
|
created_at TIMESTAMP,
|
||||||
|
updated_at TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Tabel untuk tim sampling
|
||||||
|
CREATE TABLE sampling_teams (
|
||||||
|
team_id SERIAL PRIMARY KEY,
|
||||||
|
team_name VARCHAR(100),
|
||||||
|
team_leader_id INT,
|
||||||
|
vehicle_id INT,
|
||||||
|
status VARCHAR(50) -- 'AVAILABLE', 'ASSIGNED', 'ON_DUTY'
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Tabel untuk anggota tim
|
||||||
|
CREATE TABLE team_members (
|
||||||
|
team_id INT,
|
||||||
|
staff_id INT,
|
||||||
|
role VARCHAR(50), -- 'LEADER', 'SAMPLER', 'ASSISTANT'
|
||||||
|
PRIMARY KEY (team_id, staff_id)
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 2. API Endpoint untuk Cek Ketersediaan Jadwal
|
||||||
|
|
||||||
|
```php
|
||||||
|
// Endpoint: GET /api/sampling-schedules
|
||||||
|
public function getAvailableSchedules(Request $request) {
|
||||||
|
$startDate = $request->input('start_date', date('Y-m-d'));
|
||||||
|
$endDate = $request->input('end_date', date('Y-m-d', strtotime('+7 days')));
|
||||||
|
|
||||||
|
return DB::table('sampling_schedules')
|
||||||
|
->whereBetween('date', [$startDate, $endDate])
|
||||||
|
->where('status', 'AVAILABLE')
|
||||||
|
->orderBy('date', 'asc')
|
||||||
|
->orderBy('time_slot', 'asc')
|
||||||
|
->get();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Endpoint: GET /api/sampling-schedules/{date}
|
||||||
|
public function getDayScheduleDetail($date) {
|
||||||
|
return DB::table('sampling_schedules as s')
|
||||||
|
->leftJoin('sampling_bookings as b', 's.schedule_id', '=', 'b.schedule_id')
|
||||||
|
->leftJoin('sampling_teams as t', 'b.assigned_team_id', '=', 't.team_id')
|
||||||
|
->where('s.date', $date)
|
||||||
|
->select([
|
||||||
|
's.*',
|
||||||
|
'b.project_name',
|
||||||
|
'b.location',
|
||||||
|
'b.sampling_type',
|
||||||
|
't.team_name',
|
||||||
|
DB::raw('(SELECT GROUP_CONCAT(CONCAT(staff.name, " (", tm.role, ")"))
|
||||||
|
FROM team_members tm
|
||||||
|
JOIN staff ON tm.staff_id = staff.id
|
||||||
|
WHERE tm.team_id = t.team_id) as team_members')
|
||||||
|
])
|
||||||
|
->get();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 3. Tampilan Kalender Jadwal Sampling
|
||||||
|
|
||||||
|
```text
|
||||||
|
KALENDER JADWAL SAMPLING
|
||||||
|
Periode: Februari 2025
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
SENIN SELASA RABU KAMIS JUMAT
|
||||||
|
Week 1 [PENUH] [KOSONG] [PENUH] [KOSONG] [PENUH]
|
||||||
|
5 order ------- 3 order ------- 2 order
|
||||||
|
Week 2 [KOSONG] [PENUH] [PENUH] [PENUH] [KOSONG]
|
||||||
|
------- 2 order 4 order 1 order -------
|
||||||
|
[...]
|
||||||
|
|
||||||
|
Keterangan Status:
|
||||||
|
🟢 KOSONG : Semua time slot tersedia
|
||||||
|
🟡 SEBAGIAN: Beberapa time slot terisi
|
||||||
|
🔴 PENUH : Semua time slot terisi
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 4. Detail Jadwal Harian
|
||||||
|
|
||||||
|
```text
|
||||||
|
DETAIL JADWAL SAMPLING
|
||||||
|
Tanggal: 20 Februari 2025
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
TIME SLOT: PAGI (07:00 - 10:00)
|
||||||
|
Status : BOOKED
|
||||||
|
Project : Monitoring Kualitas Air Sungai Citarum
|
||||||
|
Customer : Dinas Lingkungan Hidup Kota
|
||||||
|
PIC Customer : Siti Aminah (08765432100)
|
||||||
|
Location : 5 titik sepanjang Sungai Citarum
|
||||||
|
Tim Bertugas : Team A
|
||||||
|
- Ahmad Ramadhan (Leader)
|
||||||
|
- Budi Santoso (Sampler)
|
||||||
|
- Citra Dewi (Assistant)
|
||||||
|
Kendaraan : B 1234 CD (Mobil Lab)
|
||||||
|
Notes : Sampling multi-titik, perlu cool box extra
|
||||||
|
|
||||||
|
TIME SLOT: SIANG (11:00 - 14:00)
|
||||||
|
Status : BOOKED
|
||||||
|
Project : Pemantauan Limbah Industri
|
||||||
|
Customer : PT. Tekstil Nusantara
|
||||||
|
PIC Customer : Deni Wijaya (08567890123)
|
||||||
|
Location : Outlet IPAL
|
||||||
|
Tim Bertugas : Team B
|
||||||
|
- Eko Prasetyo (Leader)
|
||||||
|
- Fajar Nugroho (Sampler)
|
||||||
|
Notes : Sampling rutin triwulan
|
||||||
|
|
||||||
|
TIME SLOT: SORE (15:00 - 17:00)
|
||||||
|
Status : AVAILABLE
|
||||||
|
Notes : Time slot masih tersedia
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 5. Notifikasi Konflik Jadwal
|
||||||
|
|
||||||
|
```text
|
||||||
|
⚠️ PERINGATAN KONFLIK JADWAL ⚠️
|
||||||
|
Tanggal: 20 Februari 2025
|
||||||
|
Time Slot: PAGI (07:00 - 10:00)
|
||||||
|
|
||||||
|
Permintaan Baru:
|
||||||
|
- Customer: PT. Industri Kimia
|
||||||
|
- Lokasi: Kawasan Industri Pulogadung
|
||||||
|
- Jenis: Sampling Air Limbah
|
||||||
|
- Estimasi Durasi: 2 jam
|
||||||
|
|
||||||
|
Jadwal Yang Sudah Ada:
|
||||||
|
- Project: Monitoring Kualitas Air Sungai Citarum
|
||||||
|
- Tim: Team A (Sudah di-assign)
|
||||||
|
- Durasi: 3 jam
|
||||||
|
|
||||||
|
Rekomendasi:
|
||||||
|
1. Jadwalkan di time slot SORE (15:00 - 17:00)
|
||||||
|
2. Atau pilih tanggal alternatif: 21 atau 23 Februari 2025
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 6. Laporan Utilisasi Tim Sampling
|
||||||
|
|
||||||
|
```text
|
||||||
|
LAPORAN UTILISASI TIM SAMPLING
|
||||||
|
Periode: Februari 2025
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
TEAM A (Ahmad Ramadhan)
|
||||||
|
Total Assignment : 15 sampling
|
||||||
|
Completed : 12 sampling
|
||||||
|
Cancelled : 1 sampling
|
||||||
|
Pending : 2 sampling
|
||||||
|
Utilization Rate : 85%
|
||||||
|
|
||||||
|
TEAM B (Eko Prasetyo)
|
||||||
|
Total Assignment : 12 sampling
|
||||||
|
Completed : 10 sampling
|
||||||
|
Cancelled : 0 sampling
|
||||||
|
Pending : 2 sampling
|
||||||
|
Utilization Rate : 80%
|
||||||
|
|
||||||
|
[... other teams ...]
|
||||||
|
|
||||||
|
RINGKASAN:
|
||||||
|
- Total Tim Available : 4 tim
|
||||||
|
- Average Utilization : 82%
|
||||||
|
- Peak Days : Senin & Rabu
|
||||||
|
- Quiet Days : Jumat
|
||||||
|
- Overtime Assignments : 2 kasus
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 7. Alur Proses Penjadwalan
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
actor Admin as Admin Lab
|
||||||
|
participant Calendar as Kalender
|
||||||
|
participant Team as Tim Sampling
|
||||||
|
participant Customer as Pelanggan
|
||||||
|
|
||||||
|
Admin->>Calendar: Cek slot tersedia
|
||||||
|
Calendar-->>Admin: Tampilkan available slots
|
||||||
|
Admin->>Team: Cek ketersediaan tim
|
||||||
|
Team-->>Admin: Konfirmasi tim available
|
||||||
|
Admin->>Customer: Usulkan jadwal
|
||||||
|
Customer->>Admin: Konfirmasi jadwal
|
||||||
|
Admin->>Calendar: Book slot
|
||||||
|
Admin->>Team: Assign tim
|
||||||
|
Calendar-->>Team: Kirim notifikasi assignment
|
||||||
|
Team-->>Customer: Konfirmasi final jadwal
|
||||||
|
```
|
||||||
|
|
||||||
|
Sistem penjadwalan ini memungkinkan:
|
||||||
|
1. Pengecekan ketersediaan slot waktu secara real-time
|
||||||
|
2. Manajemen tim sampling yang efisien
|
||||||
|
3. Pencegahan konflik jadwal
|
||||||
|
4. Tracking utilisasi tim
|
||||||
|
5. Pelaporan kinerja tim sampling
|
||||||
|
6. Notifikasi otomatis untuk semua pihak terkait
|
||||||
|
|
||||||
[... continue with existing content ...]
|
[... continue with existing content ...]
|
||||||
Reference in New Issue
Block a user