From a0666e78d2250acd2b7fabbb80f3851ea1bc3a93 Mon Sep 17 00:00:00 2001 From: arifal hidayat Date: Sat, 14 Jun 2025 04:20:26 +0700 Subject: [PATCH] fix value dashboard verified component --- app/Services/ServiceGoogleSheet.php | 35 +++++++++++++++++++-- resources/views/dashboards/leader.blade.php | 2 +- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/app/Services/ServiceGoogleSheet.php b/app/Services/ServiceGoogleSheet.php index dcf1258..5e34df3 100644 --- a/app/Services/ServiceGoogleSheet.php +++ b/app/Services/ServiceGoogleSheet.php @@ -227,7 +227,10 @@ class ServiceGoogleSheet 'BELUM_TERVERIFIKASI' => "•BERKAS AKTUAL BELUM TERVERIFIKASI (POTENSI):", 'TERVERIFIKASI' => "•BERKAS AKTUAL TERVERIFIKASI DINAS TEKNIS 2025:", 'NON_USAHA' => "•NON USAHA: HUNIAN, SOSBUD, KEAGAMAAN", - 'USAHA' => "•USAHA: USAHA, CAMPURAN, KOLEKTIF, PRASARANA" + 'USAHA' => "•USAHA: USAHA, CAMPURAN, KOLEKTIF, PRASARANA", + 'PROSES_DINAS_TEKNIS' => "•TERPROSES DI DPUTR: belum selesai rekomtek'", + 'WAITING_KLIK_DPMPTSP' => "•TERPROSES DI PTSP: Pengiriman SKRD/ Validasi di PTSP", + 'REALISASI_TERBIT_PBG' => "•BERKAS YANG TERBIT PBG 2025:" ]; $result = []; @@ -244,8 +247,6 @@ class ServiceGoogleSheet } } - Log::info("Leader data synced", ['result' => $result]); - BigdataResume::create([ 'import_datasource_id' => $import_datasource->id, 'year' => now()->year, @@ -264,8 +265,36 @@ class ServiceGoogleSheet // TOTAL POTENSI BERKAS 'potention_count' => $this->convertToInteger($result['TOTAL_POTENSI_BERKAS']['total'] ?? null) ?? 0, 'potention_sum' => $this->convertToDecimal($result['TOTAL_POTENSI_BERKAS']['nominal'] ?? null) ?? 0, + // REALISASI TERBIT PBG + 'issuance_realization_pbg_count' => $this->convertToInteger($result['REALISASI_TERBIT_PBG']['total'] ?? null) ?? 0, + 'issuance_realization_pbg_sum' => $this->convertToDecimal($result['REALISASI_TERBIT_PBG']['nominal'] ?? null) ?? 0, + // WAITING KLIK DPMPTSP + 'waiting_click_dpmptsp_count' => $this->convertToInteger($result['WAITING_KLIK_DPMPTSP']['total'] ?? null) ?? 0, + 'waiting_click_dpmptsp_sum' => $this->convertToDecimal($result['WAITING_KLIK_DPMPTSP']['nominal'] ?? null) ?? 0, + // PROSES DINAS TEKNIS + 'process_in_technical_office_count' => $this->convertToInteger($result['PROSES_DINAS_TEKNIS']['total'] ?? null) ?? 0, + 'process_in_technical_office_sum' => $this->convertToDecimal($result['PROSES_DINAS_TEKNIS']['nominal'] ?? null) ?? 0 ]); + // Save data settings + $dataSettings = [ + 'TARGET_PAD' => $result['TARGET_PAD']['nominal'] ?? null, + 'KEKURANGAN_POTENSI' => $result['KEKURANGAN_POTENSI']['nominal'] ?? null, + 'REALISASI_TERBIT_PBG_COUNT' => $result['REALISASI_TERBIT_PBG']['total'] ?? null, + 'REALISASI_TERBIT_PBG_SUM' => $result['REALISASI_TERBIT_PBG']['nominal'] ?? null, + 'MENUNGGU_KLIK_DPMPTSP_COUNT' => $result['WAITING_KLIK_DPMPTSP']['total'] ?? null, + 'MENUNGGU_KLIK_DPMPTSP_SUM' => $result['WAITING_KLIK_DPMPTSP']['nominal'] ?? null, + 'PROSES_DINAS_TEKNIS_COUNT' => $result['PROSES_DINAS_TEKNIS']['total'] ?? null, + 'PROSES_DINAS_TEKNIS_SUM' => $result['PROSES_DINAS_TEKNIS']['nominal'] ?? null, + ]; + + foreach ($dataSettings as $key => $value) { + DataSetting::updateOrInsert( + ['key' => $key], + ['value' => $this->convertToInteger($value) ?? 0] + ); + } + $import_datasource->update([ 'status' => 'success', 'response_body' => json_encode($result), diff --git a/resources/views/dashboards/leader.blade.php b/resources/views/dashboards/leader.blade.php index 918b1d5..c81b734 100644 --- a/resources/views/dashboards/leader.blade.php +++ b/resources/views/dashboards/leader.blade.php @@ -183,5 +183,5 @@ @endsection @section('scripts') -@vite(['resources/js/dashboards/bigdata.js']) +@vite(['resources/js/dashboards/leader.js']) @endsection \ No newline at end of file