fix handle redirect and add filter data pbg task same with dashboard
This commit is contained in:
@@ -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',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user