Browse Source

latest

master
Siti Rahayu 5 years ago
parent
commit
6436217327

+ 13
- 0
app/Http/Controllers/Api/CompoundResourceController.php View File

'alamat' => $request->alamat, 'alamat' => $request->alamat,
"no_plate" => $request->no_plate, "no_plate" => $request->no_plate,
"no_cukai_jalan" => $request->no_cukai_jalan, "no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"catatan" => $request->catatan, "catatan" => $request->catatan,
"lokasi_kejadian" => '-', "lokasi_kejadian" => '-',
'latlong' => $request->Latlong, 'latlong' => $request->Latlong,
'alamat' => $request->alamat, 'alamat' => $request->alamat,
"no_plate" => $request->no_plate, "no_plate" => $request->no_plate,
"no_cukai_jalan" => $request->no_cukai_jalan, "no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"catatan" => $request->catatan, "catatan" => $request->catatan,
"lokasi_kejadian" => '-', "lokasi_kejadian" => '-',
'latlong' => $request->Latlong, 'latlong' => $request->Latlong,
'alamat' => $request->alamat, 'alamat' => $request->alamat,
"no_plate" => $request->no_plate, "no_plate" => $request->no_plate,
"no_cukai_jalan" => $request->no_cukai_jalan, "no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"catatan" => $request->catatan, "catatan" => $request->catatan,
"lokasi_kejadian" => '-', "lokasi_kejadian" => '-',
'latlong' => $request->Latlong, 'latlong' => $request->Latlong,
'alamat' => $request->alamat, 'alamat' => $request->alamat,
"no_plate" => $request->no_plate, "no_plate" => $request->no_plate,
"no_cukai_jalan" => $request->no_cukai_jalan, "no_cukai_jalan" => $request->no_cukai_jalan,
"nama_kawasan" => $request->namaKawasan,
"nama_taman" => $request->namaTaman,
"nama_jalan" => $request->namaJalan,
"catatan" => $request->catatan, "catatan" => $request->catatan,
"lokasi_kejadian" => '-', "lokasi_kejadian" => '-',
'latlong' => $request->Latlong, 'latlong' => $request->Latlong,
// } // }
$this->dispatch(new StoreCompound($request->all(), $kpd, $staff->_id, $no_siri)); $this->dispatch(new StoreCompound($request->all(), $kpd, $staff->_id, $no_siri));
array_push($data, array('kpd' => $kpd)); array_push($data, array('kpd' => $kpd));
$this->dispatch(new StoreCompoundEPBT($request->all(), $kpd, $staff->StaffDetail->full_name, $staff->StaffDetail->no_badan, $faulty->nama));


return $this->sendResponse($data, 'Berjaya simpan rekod notis!'); return $this->sendResponse($data, 'Berjaya simpan rekod notis!');
// } // }

+ 59
- 0
app/Http/Controllers/Api/EpbtController.php View File

use App\Http\Controllers\Api\BaseController; use App\Http\Controllers\Api\BaseController;
use App\Model\Database\EPBT; use App\Model\Database\EPBT;
use App\Model\Module\CodeMukim;
use Carbon\Carbon; use Carbon\Carbon;
use Config; use Config;
} }
} }
public function getcodeBandar()
{
$bandar = CodeMukim::select('JLN_MKKOD', 'MKM_MNAMA')->orderBy('JLN_MKKOD', 'ASC')->get();
$bandar_detail = [];
foreach($bandar as $i)
{
array_push($bandar_detail, array(
"JLN_MKKOD" => $i->JLN_MKKOD. " - " .$i->MKM_MNAMA,
));
}
return $this->sendResponse($bandar_detail, 'Senarai Bandar');
}
public function getcodeTaman(Request $request)
{
$tmpD = explode(" - ",$request->code_bandar);
$kawasan_detail = array();
$mukim = $tmpD[0];
$data = CodeMukim::where('JLN_MKKOD', $mukim)->orderBy('JLN_KWKOD', 'ASC')->get();
foreach($data as $i)
{
array_push($kawasan_detail, array(
"JLN_KWKOD" => $i->JLN_KWKOD. " - " .$i->KWS_KNAMA,
));
}
return $this->sendResponse($kawasan_detail, 'Senarai Kawasan');
}
public function getCodeJalan(Request $request)
{
$tmpE = explode(" - ",$request->code_mukim);
$mukim = $tmpE[0];
$tmpF = explode(" - ",$request->code_kawasan);
$kawasan = $tmpF[0];
$jalan_detail = array();
$data = CodeMukim::where('JLN_KWKOD', $kawasan)->where('JLN_MKKOD', $mukim)->orderBy('JLN_JLKOD', 'ASC')->get();
foreach($data as $i)
{
array_push($jalan_detail, array(
"JLN_JLKOD" => $i->JLN_JLKOD. " - " .$i->JLN_JNAMA,
"JLN_JNAMA" => $i->JLN_JNAMA
));
}
return $this->sendResponse($jalan_detail, 'Berjaya dapatkan rekod');
}
} }

+ 39
- 0
app/Http/Controllers/Main/TaskController.php View File

use App\Model\Module\SubHistory; use App\Model\Module\SubHistory;
use App\Model\Module\Memo; use App\Model\Module\Memo;
use App\Model\Module\Attachment; use App\Model\Module\Attachment;
use App\Model\Module\CodeMukim;
use App\Jobs\UpdateCompoundPrice; use App\Jobs\UpdateCompoundPrice;
return response()->json($response->message); return response()->json($response->message);
} }
} }
public function insertdata()
{
$roads = CodeMukim::all()->toArray();
$response = json_decode(file_get_contents(public_path(). '/mukim_kawasan_jalan_mbip.json'));
$temp = [];
if($response->success == true){
foreach ($response->data as $key => $r)
{
// search value in db COde Mukim, if none, add to array
if(!in_array($r->_id, array_column($roads, '_id')))
{
$com = new CodeMukim();
$com->_id = new \MongoDB\BSON\ObjectID($r->_id);
$com->JLN_MKKOD = $r->JLN_MKKOD;
$com->MKM_MNAMA = $r->MKM_MNAMA;
$com->JLN_KWKOD = $r->JLN_KWKOD;
$com->KWS_KNAMA = $r->KWS_KNAMA;
$com->JLN_JNAMA = $r->JLN_JNAMA;
$com->save();
if(!$com)
{
$temp[] = $r;
}
}
}
return 'data not inserted : ' . json_encode($temp);
}
}
} }

+ 61
- 35
app/Jobs/StoreCompoundEPBT.php View File



namespace App\Jobs; namespace App\Jobs;


use Carbon\Carbon;

use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\InteractsWithQueue;
$client = new \GuzzleHttp\Client(); $client = new \GuzzleHttp\Client();
$result = $client->request('GET', 'http://218.208.81.239:81/appsepbtkompaun_ws/getinfokompaun/infokompaun?infokompaun[]=352405067769401&infokompaun[]=ekpn_kesalahan'); $result = $client->request('GET', 'http://218.208.81.239:81/appsepbtkompaun_ws/getinfokompaun/infokompaun?infokompaun[]=352405067769401&infokompaun[]=ekpn_kesalahan');
$response = json_decode($result->getBody()->getContents()); $response = json_decode($result->getBody()->getContents());
dd($compound->created_at->toDateString());
$now = Carbon::now()->toDateTimeString();
if(!empty($response)) if(!empty($response))
{ {
$k = []; $k = [];
if($compound->jenis == 'Parkir') if($compound->jenis == 'Parkir')
{ {
array_push($k, array_push($k,
$this->kpd, //no kompaun
$this->kpd, //no kompaun
'KPD', //jenis kompaun 'KPD', //jenis kompaun
$r->fk_akta, //kod akta $r->fk_akta, //kod akta
strtoupper($r->kesalahan), //keterangan kesalahan strtoupper($r->kesalahan), //keterangan kesalahan
$compound->created_at->toDateString(), //tarikh $compound->created_at->toDateString(), //tarikh
$compound->created_at->toTimeString(), //masa $compound->created_at->toTimeString(), //masa
14, //tempoh 14, //tempoh
//namajalan, namataman
//kodbandar
$compound->nama_jalan .' , '. $compound->nama_taman,//namajalan, namataman
10,//kodbandar
'K',//jenis 'K',//jenis
strtoupper($compound->plate_no), //no plat strtoupper($compound->plate_no), //no plat
$compound->jumlah_asal_kompaun, //jumlah kompaun $compound->jumlah_asal_kompaun, //jumlah kompaun
strtoupper($this->no_badan), //no badan strtoupper($this->no_badan), //no badan
'-', //no pembantu penguatkuasa '-', //no pembantu penguatkuasa
strtoupper($this->enf_nama), //nama enforcer strtoupper($this->enf_nama), //nama enforcer
Carbon::now('YYYY-MM_DD hh:mm:ss'), //time created epbt
$now, //time created epbt
$r->kod, //kod kesalahan $r->kod, //kod kesalahan
$compound->nama, //nama pesalah $compound->nama, //nama pesalah
//nama jalan - alamat pesalah
//nama taman - alamat pesalah
$compound->nama_jalan,//nama jalan - alamat pesalah
$compound->nama_taman,//nama taman - alamat pesalah
'81300', //postcode '81300', //postcode
//bandar
$compound->nama_kawasan,//bandar
'JOHOR', //negeri 'JOHOR', //negeri
'B', //notis 'B', //notis
'NULL', //notisamaran 'NULL', //notisamaran
$compound->created_at->toDateString(), //tarikh $compound->created_at->toDateString(), //tarikh
$compound->created_at->toTimeString(), //masa $compound->created_at->toTimeString(), //masa
14, //tempoh 14, //tempoh
//namajalan, namataman
//kodbandar
$compound->nama_jalan .' , '. $compound->nama_taman,//namajalan, namataman
10,//kodbandar
'K',//jenis 'K',//jenis
strtoupper($compound->plate_no), //no plat strtoupper($compound->plate_no), //no plat
$compound->jumlah_asal_kompaun, //jumlah kompaun $compound->jumlah_asal_kompaun, //jumlah kompaun
strtoupper($this->no_badan), //no badan strtoupper($this->no_badan), //no badan
'-', //no pembantu penguatkuasa '-', //no pembantu penguatkuasa
strtoupper($this->enf_nama), //nama enforcer strtoupper($this->enf_nama), //nama enforcer
Carbon::now('YYYY-MM_DD hh:mm:ss'), //time created epbt
$now, //time created epbt
$r->kod, //kod kesalahan $r->kod, //kod kesalahan
$compound->nama, //nama pesalah $compound->nama, //nama pesalah
//nama jalan - alamat pesalah
//nama taman - alamat pesalah
$compound->nama_jalan,//nama jalan - alamat pesalah
$compound->nama_taman,//nama taman - alamat pesalah
'81300', //postcode '81300', //postcode
'ISKANDAR PUTERI'//bandar
$compound->nama_kawasan,//bandar
'JOHOR', //negeri 'JOHOR', //negeri
'B', //notis 'B', //notis
'NULL', //notisamaran 'NULL', //notisamaran
elseif($compound->jenis == 'Pelbagai_JPB') elseif($compound->jenis == 'Pelbagai_JPB')
{ {
array_push($k, array_push($k,
$this->kpd, //no kompaun
$this->kpd, //no kompaun
'KPD', //jenis kompaun 'KPD', //jenis kompaun
$r->fk_akta, //kod akta $r->fk_akta, //kod akta
strtoupper($r->kesalahan), //keterangan kesalahan strtoupper($r->kesalahan), //keterangan kesalahan
$compound->created_at->toDateString(), //tarikh $compound->created_at->toDateString(), //tarikh
$compound->created_at->toTimeString(), //masa $compound->created_at->toTimeString(), //masa
14, //tempoh 14, //tempoh
//namajalan, namataman
//kodbandar
$compound->nama_jalan .' , '. $compound->nama_taman,//namajalan, namataman
10,//kodbandar
'K',//jenis 'K',//jenis
strtoupper($compound->plate_no), //no plat strtoupper($compound->plate_no), //no plat
$compound->jumlah_asal_kompaun, //jumlah kompaun $compound->jumlah_asal_kompaun, //jumlah kompaun
strtoupper($this->no_badan), //no badan strtoupper($this->no_badan), //no badan
'-', //no pembantu penguatkuasa '-', //no pembantu penguatkuasa
strtoupper($this->enf_nama), //nama enforcer strtoupper($this->enf_nama), //nama enforcer
Carbon::now('YYYY-MM_DD hh:mm:ss'), //time created epbt
$now, //time created epbt
$r->kod, //kod kesalahan $r->kod, //kod kesalahan
$compound->nama, //nama pesalah $compound->nama, //nama pesalah
//nama jalan - alamat pesalah
//nama taman - alamat pesalah
$compound->nama_jalan,//nama jalan - alamat pesalah
$compound->nama_taman,//nama taman - alamat pesalah
'81300', //postcode '81300', //postcode
'ISKANDAR PUTERI'//bandar
$compound->nama_kawasan,//bandar
'JOHOR', //negeri 'JOHOR', //negeri
'B', //notis 'B', //notis
'NULL', //notisamaran 'NULL', //notisamaran
elseif($compound->jenis == 'Pelbagai_PA') elseif($compound->jenis == 'Pelbagai_PA')
{ {
array_push($k, array_push($k,
$this->kpd, //no kompaun
$this->kpd, //no kompaun
'KPD', //jenis kompaun 'KPD', //jenis kompaun
$r->fk_akta, //kod akta $r->fk_akta, //kod akta
strtoupper($r->kesalahan), //keterangan kesalahan strtoupper($r->kesalahan), //keterangan kesalahan
$compound->created_at->toDateString(), //tarikh $compound->created_at->toDateString(), //tarikh
$compound->created_at->toTimeString(), //masa $compound->created_at->toTimeString(), //masa
14, //tempoh 14, //tempoh
//namajalan, namataman
//kodbandar
$compound->nama_jalan .' , '. $compound->nama_taman,//namajalan, namataman
10,//kodbandar
'K',//jenis 'K',//jenis
strtoupper($compound->plate_no), //no plat strtoupper($compound->plate_no), //no plat
$compound->jumlah_asal_kompaun, //jumlah kompaun $compound->jumlah_asal_kompaun, //jumlah kompaun
strtoupper($this->no_badan), //no badan strtoupper($this->no_badan), //no badan
'-', //no pembantu penguatkuasa '-', //no pembantu penguatkuasa
strtoupper($this->enf_nama), //nama enforcer strtoupper($this->enf_nama), //nama enforcer
Carbon::now('YYYY-MM_DD hh:mm:ss'), //time created epbt
$now, //time created epbt
$r->kod, //kod kesalahan $r->kod, //kod kesalahan
$compound->nama, //nama pesalah $compound->nama, //nama pesalah
//nama jalan - alamat pesalah
//nama taman - alamat pesalah
$compound->nama_jalan,//nama jalan - alamat pesalah
$compound->nama_taman,//nama taman - alamat pesalah
'81300', //postcode '81300', //postcode
'ISKANDAR PUTERI'//bandar
$compound->nama_kawasan,//bandar
'JOHOR', //negeri 'JOHOR', //negeri
'B', //notis 'B', //notis
'NULL', //notisamaran 'NULL', //notisamaran
elseif($compound->jenis == 'Pelbagai_LESEN') elseif($compound->jenis == 'Pelbagai_LESEN')
{ {
array_push($k, array_push($k,
$this->kpd, //no kompaun
$this->kpd, //no kompaun
'KPD', //jenis kompaun 'KPD', //jenis kompaun
$r->fk_akta, //kod akta $r->fk_akta, //kod akta
strtoupper($r->kesalahan), //keterangan kesalahan strtoupper($r->kesalahan), //keterangan kesalahan
$compound->created_at->toDateString(), //tarikh $compound->created_at->toDateString(), //tarikh
$compound->created_at->toTimeString(), //masa $compound->created_at->toTimeString(), //masa
14, //tempoh 14, //tempoh
//namajalan, namataman
//kodbandar
$compound->nama_jalan .' , '. $compound->nama_taman,//namajalan, namataman
10,//kodbandar
'K',//jenis 'K',//jenis
strtoupper($compound->plate_no), //no plat strtoupper($compound->plate_no), //no plat
$compound->jumlah_asal_kompaun, //jumlah kompaun $compound->jumlah_asal_kompaun, //jumlah kompaun
strtoupper($this->no_badan), //no badan strtoupper($this->no_badan), //no badan
'-', //no pembantu penguatkuasa '-', //no pembantu penguatkuasa
strtoupper($this->enf_nama), //nama enforcer strtoupper($this->enf_nama), //nama enforcer
Carbon::now('YYYY-MM_DD hh:mm:ss'), //time created epbt
$now, //time created epbt
$r->kod, //kod kesalahan $r->kod, //kod kesalahan
$compound->nama, //nama pesalah $compound->nama, //nama pesalah
//nama jalan - alamat pesalah
//nama taman - alamat pesalah
$compound->nama_jalan,//nama jalan - alamat pesalah
$compound->nama_taman,//nama taman - alamat pesalah
'81300', //postcode '81300', //postcode
'ISKANDAR PUTERI'//bandar
$compound->nama_kawasan,//bandar
'JOHOR', //negeri 'JOHOR', //negeri
'B', //notis 'B', //notis
'NULL', //notisamaran 'NULL', //notisamaran


); );
} }

$urlQueryString = '';

for ($i=0; $i < count($k); $i++) {

if($i == 0)
{
$urlQueryString = $urlQueryString . '?';
}
else
{
$urlQueryString = $urlQueryString . '&';
}

$urlQueryString = $urlQueryString . 'KompaunDetails[]=' . $k[$i];
// bla/bla/my/registerkompaunDetails?KompaunDetails[]=KP45&KompaunDetails[]=ayu
}

$client = new \GuzzleHttp\Client();
$result = $client->request('GET', 'http://218.208.81.239:81/appsepbtkompaun_ws/registerkompaun/registerkompaunDetails' . $urlQueryString);

} }
else else
{ {

+ 17
- 0
app/Model/Module/CodeMukim.php View File

<?php

namespace App\Model\Module;

use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
use Jenssegers\Mongodb\Eloquent\SoftDeletes;

class CodeMukim extends Eloquent
{
//
use SoftDeletes;
protected $connection = 'mongodb';
protected $collection = 'area_roads';
protected $guarded = ['_id'];
}

+ 2360
- 0
public/mukim_kawasan_jalan_mbip.json
File diff suppressed because it is too large
View File


+ 6
- 0
routes/api.php View File

Route::post('/update/compound/payment', 'Api\RestfulapiController@updatePaymentIntegrasi'); Route::post('/update/compound/payment', 'Api\RestfulapiController@updatePaymentIntegrasi');
Route::get('/get/compound-for/epbt', 'Api\RestfulapiController@compoundToEPBT'); Route::get('/get/compound-for/epbt', 'Api\RestfulapiController@compoundToEPBT');
Route::get('/store/external/summon', 'Api\ImportDataController@storeExternalCompound'); Route::get('/store/external/summon', 'Api\ImportDataController@storeExternalCompound');
/*--------------------------------------------------------------------------
| EPBT
|---------------------------------------------------------------------------*/
Route::get('/code/bandar', 'Api\EpbtController@getCodeBandar');
Route::get('/code/taman', 'Api\EpbtController@getCodeTaman');
Route::post('/code/jalan', 'Api\EpbtController@getCodeJalan');
}); });



+ 5
- 0
routes/web.php View File



Route::get('/responsive/compound/{ic}/list', ['uses' => 'ResponsiveController@showCompoundPage']); Route::get('/responsive/compound/{ic}/list', ['uses' => 'ResponsiveController@showCompoundPage']);
Route::get('/responsive/compound/{kpd}/{ic}/view/details', ['uses' => 'ResponsiveController@requestCompoundPaymentPdf']); Route::get('/responsive/compound/{kpd}/{ic}/view/details', ['uses' => 'ResponsiveController@requestCompoundPaymentPdf']);
Route::get('/main/insert/roads', 'Main\TaskController@insertdata');



/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
| Export Data | Export Data
Route::post('/main/add-api-key', ['uses' => 'Main\SettingController@addApiKey']); Route::post('/main/add-api-key', ['uses' => 'Main\SettingController@addApiKey']);
Route::post('/main/add-api-integration', ['uses' => 'Main\SettingController@addIntegrasi']); Route::post('/main/add-api-integration', ['uses' => 'Main\SettingController@addIntegrasi']);





}); });


/* /*

Loading…
Cancel
Save