Merge branch 'dev' of 178.128.21.43:arifal/sibedas into dev
This commit is contained in:
@@ -18,6 +18,9 @@ RUN apt-get update && apt-get install -y \
|
||||
git curl zip unzip libpng-dev libonig-dev libxml2-dev libzip-dev \
|
||||
&& 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
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
|
||||
&& apt-get install -y nodejs
|
||||
@@ -64,6 +67,9 @@ RUN apt-get update && apt-get install -y \
|
||||
supervisor \
|
||||
&& 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
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
|
||||
&& apt-get install -y nodejs
|
||||
|
||||
118
app/Exports/PbgTaskExport.php
Normal file
118
app/Exports/PbgTaskExport.php
Normal 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',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -486,14 +486,14 @@ class BigDataResumeController extends Controller
|
||||
{
|
||||
try {
|
||||
// Get sum and count from PbgTaskPayment model
|
||||
$totalSum = PbgTaskPayment::whereYear('payment_date', date('Y'))->sum('pad_amount') ?? 0;
|
||||
$totalCount = PbgTaskPayment::whereYear('payment_date', date('Y'))->count() ?? 0;
|
||||
$stats = PbgTaskPayment::whereNotNull('payment_date_raw')
|
||||
->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", [
|
||||
'total_records' => $totalCount,
|
||||
'total_sum' => $totalSum,
|
||||
'source' => 'pbg_task_payments table'
|
||||
]);
|
||||
$totalSum = $stats->total_sum ?? 0;
|
||||
$totalCount = $stats->total_count ?? 0;
|
||||
|
||||
return [
|
||||
'sum' => (float) $totalSum,
|
||||
|
||||
1
docker/php/memory-limit.ini
Normal file
1
docker/php/memory-limit.ini
Normal file
@@ -0,0 +1 @@
|
||||
memory_limit=512M
|
||||
@@ -565,12 +565,11 @@ class BigData {
|
||||
document
|
||||
.querySelectorAll(".document-total.chart-payment-pbg-task")
|
||||
.forEach((element) => {
|
||||
// const sum = this.safeGet(
|
||||
// this.resumeBigData,
|
||||
// "pbg_task_payments.sum",
|
||||
// 0
|
||||
// );
|
||||
const sum = 9559353945;
|
||||
const sum = this.safeGet(
|
||||
this.resumeBigData,
|
||||
"pbg_task_payments.sum",
|
||||
0
|
||||
);
|
||||
element.innerText = `Rp.${addThousandSeparators(
|
||||
sum.toString()
|
||||
)}`;
|
||||
|
||||
Reference in New Issue
Block a user