fix render data and show count rab krk and dlh
This commit is contained in:
@@ -26,12 +26,12 @@ class BigDataResumeController extends Controller
|
|||||||
$type = $request->get("type");
|
$type = $request->get("type");
|
||||||
|
|
||||||
if (!$filterDate || $filterDate === "latest") {
|
if (!$filterDate || $filterDate === "latest") {
|
||||||
$big_data_resume = BigdataResume::where('year', $type)->latest()->first();
|
$big_data_resume = BigdataResume::where('resume_type', $type)->latest()->first();
|
||||||
if (!$big_data_resume) {
|
if (!$big_data_resume) {
|
||||||
return $this->response_empty_resume();
|
return $this->response_empty_resume();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$big_data_resume = BigdataResume::where('year', $type)
|
$big_data_resume = BigdataResume::where('resume_type', $type)
|
||||||
->whereDate('created_at', $filterDate)
|
->whereDate('created_at', $filterDate)
|
||||||
->orderBy('id', 'desc')
|
->orderBy('id', 'desc')
|
||||||
->first();
|
->first();
|
||||||
@@ -46,10 +46,6 @@ class BigDataResumeController extends Controller
|
|||||||
return response()->json(['message' => 'No data setting found']);
|
return response()->json(['message' => 'No data setting found']);
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanNumber($value) {
|
|
||||||
return floatval(str_replace('.', '', $value));
|
|
||||||
}
|
|
||||||
|
|
||||||
$target_pad = floatval(optional($data_settings->where('key', 'TARGET_PAD')->first())->value);
|
$target_pad = floatval(optional($data_settings->where('key', 'TARGET_PAD')->first())->value);
|
||||||
$realisasi_terbit_pbg_sum = $big_data_resume->issuance_realization_pbg_sum;
|
$realisasi_terbit_pbg_sum = $big_data_resume->issuance_realization_pbg_sum;
|
||||||
$realisasi_terbit_pbg_count = $big_data_resume->issuance_realization_pbg_count;
|
$realisasi_terbit_pbg_count = $big_data_resume->issuance_realization_pbg_count;
|
||||||
@@ -107,6 +103,12 @@ class BigDataResumeController extends Controller
|
|||||||
$proses_dinas_teknis_percentage = $big_data_resume->verified_sum > 0 && $proses_dinas_teknis_sum >= 0
|
$proses_dinas_teknis_percentage = $big_data_resume->verified_sum > 0 && $proses_dinas_teknis_sum >= 0
|
||||||
? round(($proses_dinas_teknis_sum / $big_data_resume->verified_sum) * 100, 2) : 0;
|
? round(($proses_dinas_teknis_sum / $big_data_resume->verified_sum) * 100, 2) : 0;
|
||||||
|
|
||||||
|
$business_rab_count = $big_data_resume->business_rab_count;
|
||||||
|
$business_krk_count = $big_data_resume->business_krk_count;
|
||||||
|
$non_business_rab_count = $big_data_resume->non_business_rab_count;
|
||||||
|
$non_business_krk_count = $big_data_resume->non_business_krk_count;
|
||||||
|
$non_business_dlh_count = $big_data_resume->non_business_dlh_count;
|
||||||
|
|
||||||
$result = [
|
$result = [
|
||||||
'target_pad' => [
|
'target_pad' => [
|
||||||
'sum' => $target_pad,
|
'sum' => $target_pad,
|
||||||
@@ -160,7 +162,12 @@ class BigDataResumeController extends Controller
|
|||||||
'sum' => $proses_dinas_teknis_sum,
|
'sum' => $proses_dinas_teknis_sum,
|
||||||
'count' => $proses_dinas_teknis_count,
|
'count' => $proses_dinas_teknis_count,
|
||||||
'percentage' => $proses_dinas_teknis_percentage
|
'percentage' => $proses_dinas_teknis_percentage
|
||||||
]
|
],
|
||||||
|
'business_rab_count' => $business_rab_count,
|
||||||
|
'business_krk_count' => $business_krk_count,
|
||||||
|
'non_business_rab_count' => $non_business_rab_count,
|
||||||
|
'non_business_krk_count' => $non_business_krk_count,
|
||||||
|
'non_business_dlh_count' => $non_business_dlh_count
|
||||||
];
|
];
|
||||||
return response()->json($result);
|
return response()->json($result);
|
||||||
}catch(\Exception $e){
|
}catch(\Exception $e){
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class BigdataResume extends Model
|
|||||||
'non_business_rab_count',
|
'non_business_rab_count',
|
||||||
'non_business_krk_count',
|
'non_business_krk_count',
|
||||||
'non_business_dlh_count',
|
'non_business_dlh_count',
|
||||||
|
'resume_type',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function importDatasource()
|
public function importDatasource()
|
||||||
|
|||||||
@@ -209,19 +209,19 @@ class PbgTaskDetail extends Model
|
|||||||
'area_type' => $data['area_type'] ?? null,
|
'area_type' => $data['area_type'] ?? null,
|
||||||
'height' => $data['height'] ?? null,
|
'height' => $data['height'] ?? null,
|
||||||
'floor' => $data['floor'] ?? null,
|
'floor' => $data['floor'] ?? null,
|
||||||
'floor_area' => $data['floor_area'] ?? null,
|
'floor_area' => $data['floor_area'] ?? 0,
|
||||||
'basement' => $data['basement'] ?? null,
|
'basement' => $data['basement'] ?? null,
|
||||||
'basement_height' => $data['basement_height'] ?? null,
|
'basement_height' => $data['basement_height'] ?? 0,
|
||||||
'basement_area' => $data['basement_area'] ?? null,
|
'basement_area' => $data['basement_area'] ?? 0,
|
||||||
'unit' => $data['unit'] ?? null,
|
'unit' => $data['unit'] ?? null,
|
||||||
'prev_retribution' => $data['prev_retribution'] ?? null,
|
'prev_retribution' => $data['prev_retribution'] ?? 0,
|
||||||
'prev_pbg' => $data['prev_pbg'] ?? null,
|
'prev_pbg' => $data['prev_pbg'] ?? null,
|
||||||
'prev_total_area' => $data['prev_total_area'] ?? null,
|
'prev_total_area' => $data['prev_total_area'] ?? 0,
|
||||||
'koefisien_dasar_bangunan' => $data['koefisien_dasar_bangunan'] ?? null,
|
'koefisien_dasar_bangunan' => $data['koefisien_dasar_bangunan'] ?? 0,
|
||||||
'koefisien_lantai_bangunan' => $data['koefisien_lantai_bangunan'] ?? null,
|
'koefisien_lantai_bangunan' => $data['koefisien_lantai_bangunan'] ?? 0,
|
||||||
'koefisien_lantai_hijau' => $data['koefisien_lantai_hijau'] ?? null,
|
'koefisien_lantai_hijau' => $data['koefisien_lantai_hijau'] ?? 0,
|
||||||
'koefisien_tapak_basement' => $data['koefisien_tapak_basement'] ?? null,
|
'koefisien_tapak_basement' => $data['koefisien_tapak_basement'] ?? 0,
|
||||||
'ketinggian_bangunan' => $data['ketinggian_bangunan'] ?? null,
|
'ketinggian_bangunan' => $data['ketinggian_bangunan'] ?? 0,
|
||||||
'jalan_arteri' => $data['jalan_arteri'] ?? null,
|
'jalan_arteri' => $data['jalan_arteri'] ?? null,
|
||||||
'jalan_kolektor' => $data['jalan_kolektor'] ?? null,
|
'jalan_kolektor' => $data['jalan_kolektor'] ?? null,
|
||||||
'jalan_bangunan' => $data['jalan_bangunan'] ?? null,
|
'jalan_bangunan' => $data['jalan_bangunan'] ?? null,
|
||||||
|
|||||||
@@ -276,7 +276,8 @@ class ServiceGoogleSheet
|
|||||||
|
|
||||||
BigdataResume::create([
|
BigdataResume::create([
|
||||||
'import_datasource_id' => $import_datasource->id,
|
'import_datasource_id' => $import_datasource->id,
|
||||||
'year' => 'leader',
|
'year' => now()->year(),
|
||||||
|
'resume_type' => 'leader',
|
||||||
// USAHA
|
// USAHA
|
||||||
'business_count' => $this->convertToInteger($result['USAHA']['total'] ?? null) ?? 0,
|
'business_count' => $this->convertToInteger($result['USAHA']['total'] ?? null) ?? 0,
|
||||||
'business_sum' => $this->convertToDecimal($result['USAHA']['nominal'] ?? null) ?? 0,
|
'business_sum' => $this->convertToDecimal($result['USAHA']['nominal'] ?? null) ?? 0,
|
||||||
@@ -303,7 +304,12 @@ class ServiceGoogleSheet
|
|||||||
'process_in_technical_office_sum' => $this->convertToDecimal($result['PROSES_DINAS_TEKNIS']['nominal'] ?? null) ?? 0,
|
'process_in_technical_office_sum' => $this->convertToDecimal($result['PROSES_DINAS_TEKNIS']['nominal'] ?? null) ?? 0,
|
||||||
// TATA RUANG
|
// TATA RUANG
|
||||||
'spatial_count' => $this->getSpatialPlanningWithCalculationCount(),
|
'spatial_count' => $this->getSpatialPlanningWithCalculationCount(),
|
||||||
'spatial_sum' => $this->getSpatialPlanningCalculationSum()
|
'spatial_sum' => $this->getSpatialPlanningCalculationSum(),
|
||||||
|
'business_rab_count' => 0,
|
||||||
|
'business_krk_count' => 0,
|
||||||
|
'non_business_rab_count' => 0,
|
||||||
|
'non_business_krk_count' => 0,
|
||||||
|
'non_business_dlh_count' => 0,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Save data settings
|
// Save data settings
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ class BigData {
|
|||||||
this.initChartMenungguKlikDPMPTSP();
|
this.initChartMenungguKlikDPMPTSP();
|
||||||
this.initChartProsesDinasTeknis();
|
this.initChartProsesDinasTeknis();
|
||||||
this.initChartPotensiTataRuang();
|
this.initChartPotensiTataRuang();
|
||||||
|
this.initChartBusinessRAB();
|
||||||
|
this.initChartBusinessKRK();
|
||||||
|
this.initChartNonBusinessRAB();
|
||||||
|
this.initChartNonBusinessKRK();
|
||||||
|
this.initChartNonBusinessDLH();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
@@ -318,6 +323,37 @@ class BigData {
|
|||||||
element.innerText = `${this.resumeBigData.tata_ruang.percentage}%`;
|
element.innerText = `${this.resumeBigData.tata_ruang.percentage}%`;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
initChartBusinessRAB() {
|
||||||
|
document.querySelectorAll("#business-rab-count").forEach((element) => {
|
||||||
|
element.innerText = `${this.resumeBigData.business_rab_count}`;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
initChartBusinessKRK() {
|
||||||
|
document.querySelectorAll("#business-krk-count").forEach((element) => {
|
||||||
|
element.innerText = `${this.resumeBigData.business_krk_count}`;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
initChartNonBusinessRAB() {
|
||||||
|
document
|
||||||
|
.querySelectorAll("#non-business-rab-count")
|
||||||
|
.forEach((element) => {
|
||||||
|
element.innerText = `${this.resumeBigData.non_business_rab_count}`;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
initChartNonBusinessKRK() {
|
||||||
|
document
|
||||||
|
.querySelectorAll("#non-business-krk-count")
|
||||||
|
.forEach((element) => {
|
||||||
|
element.innerText = `${this.resumeBigData.non_business_krk_count}`;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
initChartNonBusinessDLH() {
|
||||||
|
document
|
||||||
|
.querySelectorAll("#non-business-dlh-count")
|
||||||
|
.forEach((element) => {
|
||||||
|
element.innerText = `${this.resumeBigData.non_business_dlh_count}`;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", async function (e) {
|
document.addEventListener("DOMContentLoaded", async function (e) {
|
||||||
|
|||||||
@@ -100,14 +100,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="position: absolute; top: 50px; left: 900px; width: 200px; height: 200px; ">
|
<div style="position: absolute; top: 50px; left: 900px; width: 200px; height: 200px; ">
|
||||||
<x-custom-circle title="RAB dan Gambar" size="medium" style="background-color: #da6635;float:left;margin-left:250px;"
|
<x-custom-circle title="RAB dan Gambar" size="medium" style="background-color: #c23c3c;float:left;margin-left:250px;"
|
||||||
visible_data="true" data_id="business-rab-count" data_count="0"
|
visible_data="true" data_id="business-rab-count" data_count="0"
|
||||||
document_url="{{ route('web-spatial-plannings.index', ['menu_id' => $menus->where('url','web-spatial-plannings.index')->first()->id]) }}"
|
document_url="{{ route('web-spatial-plannings.index', ['menu_id' => $menus->where('url','web-spatial-plannings.index')->first()->id]) }}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="position: absolute; top: 160px; left: 900px; width: 200px; height: 200px; ">
|
<div style="position: absolute; top: 160px; left: 900px; width: 200px; height: 200px; ">
|
||||||
<x-custom-circle title="KRK" size="medium" style="background-color: #da6635;float:left;margin-left:250px;"
|
<x-custom-circle title="KRK" size="medium" style="background-color: #295040;float:left;margin-left:250px;"
|
||||||
visible_data="true" data_id="business-krk-count" data_count="0"
|
visible_data="true" data_id="business-krk-count" data_count="0"
|
||||||
document_url="{{ route('web-spatial-plannings.index', ['menu_id' => $menus->where('url','web-spatial-plannings.index')->first()->id]) }}"
|
document_url="{{ route('web-spatial-plannings.index', ['menu_id' => $menus->where('url','web-spatial-plannings.index')->first()->id]) }}"
|
||||||
/>
|
/>
|
||||||
@@ -123,21 +123,21 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="position: absolute; top: 350px; left: 900px; width: 200px; height: 200px; ">
|
<div style="position: absolute; top: 350px; left: 900px; width: 200px; height: 200px; ">
|
||||||
<x-custom-circle title="RAB dan Gambar" size="medium" style="background-color: #da6635;float:left;margin-left:250px;"
|
<x-custom-circle title="RAB dan Gambar" size="medium" style="background-color: #ad4343;float:left;margin-left:250px;"
|
||||||
visible_data="true" data_id="non-business-rab-count" data_count="0"
|
visible_data="true" data_id="non-business-rab-count" data_count="0"
|
||||||
document_url="{{ route('web-spatial-plannings.index', ['menu_id' => $menus->where('url','web-spatial-plannings.index')->first()->id]) }}"
|
document_url="{{ route('web-spatial-plannings.index', ['menu_id' => $menus->where('url','web-spatial-plannings.index')->first()->id]) }}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="position: absolute; top: 460px; left: 900px; width: 200px; height: 200px; ">
|
<div style="position: absolute; top: 460px; left: 900px; width: 200px; height: 200px; ">
|
||||||
<x-custom-circle title="KRK" size="medium" style="background-color: #da6635;float:left;margin-left:250px;"
|
<x-custom-circle title="KRK" size="medium" style="background-color: #51db51;float:left;margin-left:250px;"
|
||||||
visible_data="true" data_id="non-business-krk-count" data_count="0"
|
visible_data="true" data_id="non-business-krk-count" data_count="0"
|
||||||
document_url="{{ route('web-spatial-plannings.index', ['menu_id' => $menus->where('url','web-spatial-plannings.index')->first()->id]) }}"
|
document_url="{{ route('web-spatial-plannings.index', ['menu_id' => $menus->where('url','web-spatial-plannings.index')->first()->id]) }}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="position: absolute; top: 570px; left: 900px; width: 200px; height: 200px; ">
|
<div style="position: absolute; top: 570px; left: 900px; width: 200px; height: 200px; ">
|
||||||
<x-custom-circle title="DLH" size="medium" style="background-color: #da6635;float:left;margin-left:250px;"
|
<x-custom-circle title="DLH" size="medium" style="background-color: #331d04;float:left;margin-left:250px;"
|
||||||
visible_data="true" data_id="non-business-dlh-count" data_count="0"
|
visible_data="true" data_id="non-business-dlh-count" data_count="0"
|
||||||
document_url="{{ route('web-spatial-plannings.index', ['menu_id' => $menus->where('url','web-spatial-plannings.index')->first()->id]) }}"
|
document_url="{{ route('web-spatial-plannings.index', ['menu_id' => $menus->where('url','web-spatial-plannings.index')->first()->id]) }}"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user