Bug #26748
Updated by Suphawan Phiwngam 16 days ago
เมื่อเลือก filter เดียวกัน (Assembly machine, 2025-12-17) ค่า Performance gauge = 86.17% ตรงกันทั้ง 2 หน้า แต่ค่าในตาราง/summary ไม่ตรงกัน เพราะ 2 หน้าใช้คนละ API คนละวิธีคำนวณ:
- **Performance Dashboard** → `/v1.2/oee` + `/v1.2/job/tracking`
- **Overview Dashboard** → `/v1.3/oee/machine-dashboard`
*ปัญหาที่พบ ## ปัญหาที่พบ 3 จุด*
จุด
**1. PP ใน Shift Matrix ≠ Prod. Plan ใน Summary Table**
- Shift Matrix ใช้ `p_ideal_target` (ชิ้นที่ควรผลิตได้ตาม ideal cycle time × run time)
- Summary Table ใช้ `job.target` (เป้าหมายจาก Job setting)
- ไฟล์: `get-machine-dashboard.js` → `buildJobRows()` line ~75: `prodPlan: job.target`
- ไฟล์: `get-all-shifts.js` → shift aggregation ใช้ `history.p_ideal_target`
**2. ACT1 ใน Shift Matrix ≠ MC Run ใน Summary Table**
- Shift Matrix: ACT1 = `p_run_time` (เวลาเครื่องทำงาน เป็นวินาที)
- Summary Table: MC Run = `job.target` (เป้าหมายจำนวนชิ้น — ค่าเดียวกับ Prod. Plan)
- ไฟล์: `get-machine-dashboard.js` → `buildJobRows()` line ~76: `mcRun: job.target`
**3. Performance Dashboard ผสมข้อมูลจาก 2 API คนละแหล่ง**
- P1 (Production Plan) = `summary.target` ← จาก `/v1.2/job/tracking`
- P2 (Machine Working) = `oeeData.p_ideal_target` ← จาก `/v1.2/oee`
- Actual = `summary.actual` ← จาก `/v1.2/job/tracking`
- ไฟล์: `PerformanceDashboard.js` line ~280-310
- **Performance Dashboard** → `/v1.2/oee` + `/v1.2/job/tracking`
- **Overview Dashboard** → `/v1.3/oee/machine-dashboard`
*ปัญหาที่พบ ## ปัญหาที่พบ 3 จุด*
จุด
**1. PP ใน Shift Matrix ≠ Prod. Plan ใน Summary Table**
- Shift Matrix ใช้ `p_ideal_target` (ชิ้นที่ควรผลิตได้ตาม ideal cycle time × run time)
- Summary Table ใช้ `job.target` (เป้าหมายจาก Job setting)
- ไฟล์: `get-machine-dashboard.js` → `buildJobRows()` line ~75: `prodPlan: job.target`
- ไฟล์: `get-all-shifts.js` → shift aggregation ใช้ `history.p_ideal_target`
**2. ACT1 ใน Shift Matrix ≠ MC Run ใน Summary Table**
- Shift Matrix: ACT1 = `p_run_time` (เวลาเครื่องทำงาน เป็นวินาที)
- Summary Table: MC Run = `job.target` (เป้าหมายจำนวนชิ้น — ค่าเดียวกับ Prod. Plan)
- ไฟล์: `get-machine-dashboard.js` → `buildJobRows()` line ~76: `mcRun: job.target`
**3. Performance Dashboard ผสมข้อมูลจาก 2 API คนละแหล่ง**
- P1 (Production Plan) = `summary.target` ← จาก `/v1.2/job/tracking`
- P2 (Machine Working) = `oeeData.p_ideal_target` ← จาก `/v1.2/oee`
- Actual = `summary.actual` ← จาก `/v1.2/job/tracking`
- ไฟล์: `PerformanceDashboard.js` line ~280-310