diff --git a/app/Enums/PbgTaskFilterData.php b/app/Enums/PbgTaskFilterData.php index 611bef5..fcf4959 100644 --- a/app/Enums/PbgTaskFilterData.php +++ b/app/Enums/PbgTaskFilterData.php @@ -9,6 +9,10 @@ enum PbgTaskFilterData : string case verified = 'verified'; case non_verified = 'non-verified'; case all = 'all'; + case potention = 'potention'; + case issuance_realization_pbg = 'issuance-realization-pbg'; + case process_in_technical_office = 'process-in-technical-office'; + case waiting_click_dpmptsp = 'waiting-click-dpmptsp'; public static function getAllOptions() : array { return [ @@ -17,6 +21,10 @@ enum PbgTaskFilterData : string self::non_business->value => 'Bukan Usaha', self::verified->value => 'Terverifikasi', self::non_verified->value => 'Belum Terverifikasi', + self::potention->value => 'Potensi', + self::issuance_realization_pbg->value => 'Realisasi PBG', + self::process_in_technical_office->value => 'Proses Di Dinas Teknis', + self::waiting_click_dpmptsp->value => 'Menunggu Klik DPMPTSP', ]; } } diff --git a/app/Http/Controllers/Api/RequestAssignmentController.php b/app/Http/Controllers/Api/RequestAssignmentController.php index 8a07763..b912ada 100644 --- a/app/Http/Controllers/Api/RequestAssignmentController.php +++ b/app/Http/Controllers/Api/RequestAssignmentController.php @@ -13,6 +13,7 @@ use Exception; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; use Maatwebsite\Excel\Facades\Excel; +use App\Enums\PbgTaskStatus; class RequestAssignmentController extends Controller { @@ -37,8 +38,11 @@ class RequestAssignmentController extends Controller $q->where(function ($q2) { $q2->whereRaw("LOWER(function_type) NOT LIKE ?", ['%fungsi usaha%']) ->whereRaw("LOWER(function_type) NOT LIKE ?", ['%sebagai tempat usaha%']) - ->whereRaw("status != ?", 20) - ->orWhereNull('function_type'); + ->whereIn("status", PbgTaskStatus::getNonVerified()); + }) + ->orWhere(function ($q3) { + $q3->whereNull('function_type') + ->whereIn("status", PbgTaskStatus::getNonVerified()); }); }); break; @@ -48,19 +52,30 @@ class RequestAssignmentController extends Controller $q->where(function ($q2) { $q2->whereRaw("LOWER(function_type) LIKE ?", ['%fungsi usaha%']) ->orWhereRaw("LOWER(function_type) LIKE ?", ['%sebagai tempat usaha%']) - ->whereRaw("status != ?", 20); + ->whereIn("status", PbgTaskStatus::getNonVerified()); }); }); break; case 'verified': - $query->whereRaw("status = ?", 20); + $query->whereIn("status", PbgTaskStatus::getVerified()); break; case 'non-verified': - $query->where(function ($q) { - $q->whereRaw("status != ?", 20); - }); + $query->whereIn("status", PbgTaskStatus::getNonVerified()); + break; + + case 'potention': + $query->whereIn("status", PbgTaskStatus::getPotention()); + break; + case 'issuance-realization-pbg': + $query->whereIn("status", PbgTaskStatus::getIssuanceRealizationPbg()); + break; + case 'process-in-technical-office': + $query->whereIn("status", PbgTaskStatus::getProcessInTechnicalOffice()); + break; + case 'waiting-click-dpmptsp': + $query->whereIn("status", PbgTaskStatus::getWaitingClickDpmptsp()); break; } } diff --git a/app/Models/BigdataResume.php b/app/Models/BigdataResume.php index b8bc39b..8bd2466 100644 --- a/app/Models/BigdataResume.php +++ b/app/Models/BigdataResume.php @@ -5,6 +5,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; use App\Enums\PbgTaskStatus; +use App\Services\ServiceGoogleSheet; class BigdataResume extends Model { @@ -73,10 +74,12 @@ class BigdataResume extends Model ") ->first(); + $service_google_sheet = app(ServiceGoogleSheet::class); + return self::create([ 'import_datasource_id' => $import_datasource_id, - 'spatial_count' => $data_setting['SPATIAL_PLANNING_COUNT'] ?? 0, - 'spatial_sum' => $data_setting['SPATIAL_PLANNING_SUM'] ?? 0.00, + 'spatial_count' => $service_google_sheet->getSpatialPlanningWithCalculationCount() ?? 0, + 'spatial_sum' => $service_google_sheet->getSpatialPlanningCalculationSum() ?? 0.00, 'potention_count' => ($stats->potention_count ?? 0), 'potention_sum' => ($stats->potention_total ?? 0), 'non_verified_count' => $stats->non_verified_count ?? 0, diff --git a/resources/views/dashboards/bigdata.blade.php b/resources/views/dashboards/bigdata.blade.php index 407f501..01e12ea 100644 --- a/resources/views/dashboards/bigdata.blade.php +++ b/resources/views/dashboards/bigdata.blade.php @@ -146,7 +146,7 @@ 'document_id' => 'chart-realisasi-tebit-pbg', 'visible_small_circle' => true, 'style' => 'top:550px;left:100px;', - 'document_url' => 'https://docs.google.com/spreadsheets/d/1QoXzuLdEX3MK70Yrfigz0Qj5rAt4T819jX85vubBNdY/edit?gid=1514195399#gid=1514195399' + 'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'issuance-realization-pbg']) ]) @endcomponent @@ -160,7 +160,7 @@ 'document_id' => 'chart-menunggu-klik-dpmptsp', 'visible_small_circle' => true, 'style' => 'top:550px;left:400px', - 'document_url' => 'https://docs.google.com/spreadsheets/d/1QoXzuLdEX3MK70Yrfigz0Qj5rAt4T819jX85vubBNdY/edit?gid=1514195399#gid=1514195399' + 'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'waiting-click-dpmptsp']) ]) @endcomponent @@ -174,7 +174,7 @@ 'document_id' => 'chart-proses-dinas-teknis', 'visible_small_circle' => true, 'style' => 'top:550px;left:700px', - 'document_url' => 'https://docs.google.com/spreadsheets/d/1QoXzuLdEX3MK70Yrfigz0Qj5rAt4T819jX85vubBNdY/edit?gid=1514195399#gid=1514195399' + 'document_url' => route('pbg-task.index', ['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'process-in-technical-office']) ]) @endcomponent