Merge branch 'dev' of 178.128.21.43:arifal/sibedas into dev

This commit is contained in:
arifal hidayat
2025-09-11 23:33:35 +07:00
5 changed files with 137 additions and 13 deletions

View File

@@ -18,6 +18,9 @@ RUN apt-get update && apt-get install -y \
git curl zip unzip libpng-dev libonig-dev libxml2-dev libzip-dev \ git curl zip unzip libpng-dev libonig-dev libxml2-dev libzip-dev \
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip && docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip
# Override PHP memory limit
COPY docker/php/memory-limit.ini /usr/local/etc/php/conf.d/memory-limit.ini
# Install Node.js # Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs && apt-get install -y nodejs
@@ -64,6 +67,9 @@ RUN apt-get update && apt-get install -y \
supervisor \ supervisor \
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip && docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip
# Override PHP memory limit
COPY docker/php/memory-limit.ini /usr/local/etc/php/conf.d/memory-limit.ini
# Install Node.js # Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs && apt-get install -y nodejs

View File

@@ -0,0 +1,118 @@
<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use App\Models\PbgTask;
use App\Enums\PbgTaskFilterData;
class PbgTaskExport implements FromCollection, WithHeadings
{
protected $category;
protected $year;
public function __construct(string $category, int $year)
{
$this->category = $category;
$this->year = $year;
}
/**
* @return \Illuminate\Support\Collection
*/
public function collection()
{
$query = PbgTask::query()
->whereYear('task_created_at', $this->year);
// Menggunakan switch case karena lebih readable dan maintainable
// untuk multiple conditions yang berbeda
switch ($this->category) {
case PbgTaskFilterData::all->value:
// Tidak ada filter tambahan, ambil semua data
break;
case PbgTaskFilterData::business->value:
$query->where('application_type', 'business');
break;
case PbgTaskFilterData::non_business->value:
$query->where('application_type', 'non-business');
break;
case PbgTaskFilterData::verified->value:
$query->where('is_valid', true);
break;
case PbgTaskFilterData::non_verified->value:
$query->where('is_valid', false);
break;
case PbgTaskFilterData::potention->value:
$query->where('status', 'potention');
break;
case PbgTaskFilterData::issuance_realization_pbg->value:
$query->where('status', 'issuance-realization-pbg');
break;
case PbgTaskFilterData::process_in_technical_office->value:
$query->where('status', 'process-in-technical-office');
break;
case PbgTaskFilterData::waiting_click_dpmptsp->value:
$query->where('status', 'waiting-click-dpmptsp');
break;
case PbgTaskFilterData::non_business_rab->value:
$query->where('application_type', 'non-business')
->where('consultation_type', 'rab');
break;
case PbgTaskFilterData::non_business_krk->value:
$query->where('application_type', 'non-business')
->where('consultation_type', 'krk');
break;
case PbgTaskFilterData::business_rab->value:
$query->where('application_type', 'business')
->where('consultation_type', 'rab');
break;
case PbgTaskFilterData::business_krk->value:
$query->where('application_type', 'business')
->where('consultation_type', 'krk');
break;
case PbgTaskFilterData::business_dlh->value:
$query->where('application_type', 'business')
->where('consultation_type', 'dlh');
break;
default:
// Jika category tidak dikenali, return empty collection
return collect();
}
return $query->select([
'registration_number',
'document_number',
'owner_name',
'address',
'name as building_name',
'function_type'
])->get();
}
public function headings(): array{
return [
'Nomor Registrasi',
'Nomor Dokumen',
'Nama Pemilik',
'Alamat Pemilik',
'Nama Bangunan',
'Fungsi Bangunan',
];
}
}

View File

@@ -486,14 +486,14 @@ class BigDataResumeController extends Controller
{ {
try { try {
// Get sum and count from PbgTaskPayment model // Get sum and count from PbgTaskPayment model
$totalSum = PbgTaskPayment::whereYear('payment_date', date('Y'))->sum('pad_amount') ?? 0; $stats = PbgTaskPayment::whereNotNull('payment_date_raw')
$totalCount = PbgTaskPayment::whereYear('payment_date', date('Y'))->count() ?? 0; ->whereNotNull('retribution_total_pad')
->whereYear('payment_date_raw', date('Y'))
->selectRaw('SUM(retribution_total_pad) as total_sum, COUNT(*) as total_count')
->first();
Log::info("Real-time PBG Task Payments Data", [ $totalSum = $stats->total_sum ?? 0;
'total_records' => $totalCount, $totalCount = $stats->total_count ?? 0;
'total_sum' => $totalSum,
'source' => 'pbg_task_payments table'
]);
return [ return [
'sum' => (float) $totalSum, 'sum' => (float) $totalSum,

View File

@@ -0,0 +1 @@
memory_limit=512M

View File

@@ -565,12 +565,11 @@ class BigData {
document document
.querySelectorAll(".document-total.chart-payment-pbg-task") .querySelectorAll(".document-total.chart-payment-pbg-task")
.forEach((element) => { .forEach((element) => {
// const sum = this.safeGet( const sum = this.safeGet(
// this.resumeBigData, this.resumeBigData,
// "pbg_task_payments.sum", "pbg_task_payments.sum",
// 0 0
// ); );
const sum = 9559353945;
element.innerText = `Rp.${addThousandSeparators( element.innerText = `Rp.${addThousandSeparators(
sum.toString() sum.toString()
)}`; )}`;