change format for fill column harim
This commit is contained in:
10
.env.example
10
.env.example
@@ -71,23 +71,23 @@ FMS_ERROR_RATE_URL=
|
|||||||
FMS_ERROR_RATE_PASSWORD=
|
FMS_ERROR_RATE_PASSWORD=
|
||||||
FMS_ERROR_RATE_USERNAME=
|
FMS_ERROR_RATE_USERNAME=
|
||||||
|
|
||||||
HARIM_NEED_ACCESS_URL=
|
HARIM_NEED_ACCESS_URL='https://zamin.gov.ir/ow/api/ow/esb/response',
|
||||||
HARIM_NEED_ACCESS_PASSWORD=
|
HARIM_NEED_ACCESS_PASSWORD=
|
||||||
HARIM_NEED_ACCESS_USERNAME=
|
HARIM_NEED_ACCESS_USERNAME=
|
||||||
|
|
||||||
HARIM_REJECT_URL=
|
HARIM_REJECT_URL='https://zamin.gov.ir/ow/api/ow/esb/response'
|
||||||
HARIM_REJECT_PASSWORD=
|
HARIM_REJECT_PASSWORD=
|
||||||
HARIM_REJECT_USERNAME=
|
HARIM_REJECT_USERNAME=
|
||||||
|
|
||||||
HARIM_NO_NEED_ACCESS_URL=
|
HARIM_NO_NEED_ACCESS_URL='https://zamin.gov.ir/ow/api/ow/esb/response'
|
||||||
HARIM_NO_NEED_ACCESS_PASSWORD=
|
HARIM_NO_NEED_ACCESS_PASSWORD=
|
||||||
HARIM_NO_NEED_ACCESS_USERNAME=
|
HARIM_NO_NEED_ACCESS_USERNAME=
|
||||||
|
|
||||||
HARIM_EDIT_ACCESS_URL=
|
HARIM_EDIT_ACCESS_URL='https://zamin.gov.ir/ow/api/ow/esb/response'
|
||||||
HARIM_EDIT_ACCESS_PASSWORD=
|
HARIM_EDIT_ACCESS_PASSWORD=
|
||||||
HARIM_EDIT_ACCESS_USERNAME=
|
HARIM_EDIT_ACCESS_USERNAME=
|
||||||
|
|
||||||
HARIM_NEED_GUARANTEE_LETTER_URL=
|
HARIM_NEED_GUARANTEE_LETTER_URL='https://zamin.gov.ir/ow/api/ow/esb/response'
|
||||||
HARIM_NEED_GUARANTEE_LETTER_PASSWORD=
|
HARIM_NEED_GUARANTEE_LETTER_PASSWORD=
|
||||||
HARIM_NEED_GUARANTEE_LETTER_USERNAME=
|
HARIM_NEED_GUARANTEE_LETTER_USERNAME=
|
||||||
|
|
||||||
|
|||||||
@@ -12,13 +12,14 @@ use App\Http\Traits\ApiResponse;
|
|||||||
use App\Models\City;
|
use App\Models\City;
|
||||||
use App\Models\Harim;
|
use App\Models\Harim;
|
||||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class PanjareVahedController extends Controller
|
class PanjareVahedController extends Controller
|
||||||
{
|
{
|
||||||
use ApiResponse;
|
use ApiResponse;
|
||||||
|
|
||||||
public function receiveNewRequest(ReceiveNewRequest $request)
|
public function receiveNewRequest(ReceiveNewRequest $request): JsonResponse
|
||||||
{
|
{
|
||||||
$wkt = 'POLYGON((' . implode(',', array_map(fn($c) => "{$c[0]} {$c[1]}", $request->primary_area['coordinates'])) . '))';
|
$wkt = 'POLYGON((' . implode(',', array_map(fn($c) => "{$c[0]} {$c[1]}", $request->primary_area['coordinates'])) . '))';
|
||||||
$result = DB::selectOne("SELECT ST_AsText(ST_PointOnSurface(ST_GeomFromText(?, 4326))) AS point", [$wkt]);
|
$result = DB::selectOne("SELECT ST_AsText(ST_PointOnSurface(ST_GeomFromText(?, 4326))) AS point", [$wkt]);
|
||||||
@@ -43,7 +44,7 @@ class PanjareVahedController extends Controller
|
|||||||
|
|
||||||
$state = HarimStates::BARESI_EDARE_SHAHRESTAN->value;
|
$state = HarimStates::BARESI_EDARE_SHAHRESTAN->value;
|
||||||
|
|
||||||
Harim::query()->create([
|
$harim = Harim::query()->create([
|
||||||
'state_id' => $state,
|
'state_id' => $state,
|
||||||
'state_name' => HarimStates::name($state),
|
'state_name' => HarimStates::name($state),
|
||||||
'panjare_vahed_id' => $request->request_id,
|
'panjare_vahed_id' => $request->request_id,
|
||||||
@@ -66,55 +67,68 @@ class PanjareVahedController extends Controller
|
|||||||
'token' => $request->data['token'],
|
'token' => $request->data['token'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this->successResponse([
|
return response()->json([
|
||||||
|
'id' => $harim->id,
|
||||||
'city' => $city->edarateShahri()->first()->name_fa,
|
'city' => $city->edarateShahri()->first()->name_fa,
|
||||||
'province' => $city->province()->first()->name_fa,
|
'province' => $city->province()->first()->name_fa,
|
||||||
|
'statusCode' => 200,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAccessRoad(GetAccessRoadRequest $request)
|
public function getAccessRoad(GetAccessRoadRequest $request): JsonResponse
|
||||||
{
|
{
|
||||||
$state = HarimStates::BARESI_FILE_APLODE_SHODE_TAVASOTE_DAFTAR_HARIM->value;
|
$state = HarimStates::BARESI_FILE_APLODE_SHODE_TAVASOTE_DAFTAR_HARIM->value;
|
||||||
|
|
||||||
Harim::query()
|
$harim = Harim::query()->firstWhere('panjare_vahed_id', '=', $request->request_id);
|
||||||
->firstWhere('panjare_vahed_id', '=', $request->request_id)
|
|
||||||
->update([
|
$harim->update([
|
||||||
'state_id' => $state,
|
'state_id' => $state,
|
||||||
'state_name' => HarimStates::name($state),
|
'state_name' => HarimStates::name($state),
|
||||||
'access_road' => json_encode($request->access_road),
|
'access_road' => json_encode($request->access_road),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this->successResponse();
|
return response()->json([
|
||||||
|
'id' => $harim->id,
|
||||||
|
'statusCode' => 200,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRejectRequest(GetRejectRequest $request)
|
public function getRejectRequest(GetRejectRequest $request): JsonResponse
|
||||||
{
|
{
|
||||||
$state = HarimStates::MOKHALEFAT_BA_DASTGAH->value;
|
$state = HarimStates::MOKHALEFAT_BA_DASTGAH->value;
|
||||||
|
|
||||||
Harim::query()
|
$harim = Harim::query()->firstWhere('panjare_vahed_id', '=', $request->request_id);
|
||||||
->firstWhere('panjare_vahed_id', '=', $request->request_id)
|
|
||||||
->update([
|
|
||||||
'state_id' => $state,
|
|
||||||
'state_name' => HarimStates::name($state),
|
|
||||||
]);
|
|
||||||
|
|
||||||
return $this->successResponse();
|
|
||||||
|
$harim->update([
|
||||||
|
'state_id' => $state,
|
||||||
|
'state_name' => HarimStates::name($state),
|
||||||
|
]);
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'id' => $harim->id,
|
||||||
|
'statusCode' => 200,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getFinalPolygons(GetFinalPolygonsRequest $request)
|
public function getFinalPolygons(GetFinalPolygonsRequest $request): JsonResponse
|
||||||
{
|
{
|
||||||
$state = HarimStates::TAEDE_ARSE_VA_AYAN_ERSAL_SHODE_TAVASOT_DAFTAR_HARIM->value;
|
$state = HarimStates::TAEDE_ARSE_VA_AYAN_ERSAL_SHODE_TAVASOT_DAFTAR_HARIM->value;
|
||||||
|
|
||||||
Harim::query()
|
$harim = Harim::query()->firstWhere('panjare_vahed_id', '=', $request->request_id);
|
||||||
->firstWhere('panjare_vahed_id', '=', $request->request_id)
|
|
||||||
->update([
|
|
||||||
'state_id' => $state,
|
|
||||||
'state_name' => HarimStates::name($state),
|
|
||||||
'final_area' => json_encode($request->final_area),
|
|
||||||
'final_plan' => json_encode($request->final_plan),
|
|
||||||
]);
|
|
||||||
|
|
||||||
return $this->successResponse();
|
|
||||||
|
$harim->update([
|
||||||
|
'state_id' => $state,
|
||||||
|
'state_name' => HarimStates::name($state),
|
||||||
|
'final_area' => json_encode($request->final_area),
|
||||||
|
'final_plan' => json_encode($request->final_plan),
|
||||||
|
]);
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'id' => $harim->id,
|
||||||
|
'statusCode' => 200,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,15 +32,22 @@ class ConfirmGuaranteeLetterNeedListener implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle(ConfirmGuaranteeLetterNeedEvent $event): void
|
public function handle(ConfirmGuaranteeLetterNeedEvent $event): void
|
||||||
{
|
{
|
||||||
Http::post($this->url,
|
$encodedData = openssl_decrypt($event->harim->data);
|
||||||
array(
|
|
||||||
'' => $event->harim->id,
|
$data = [
|
||||||
'' => $event->harim->id,
|
'data' => [
|
||||||
'' => $event->harim->id,
|
'actionId' => $encodedData['actionId'],
|
||||||
'' => $event->harim->id,
|
'ruleId' => $encodedData['ruleId'],
|
||||||
'' => $event->harim->id,
|
'activityId' => $encodedData['activityId'],
|
||||||
'' => $event->harim->id,
|
'requestId' => $encodedData['requestId'],
|
||||||
'' => $event->harim->id,
|
'taskId' => $encodedData['taskId'],
|
||||||
))->throw();
|
'code' => $encodedData['code'],
|
||||||
|
'warrantStatus' => $encodedData['warrantStatus'],
|
||||||
|
'amountPaid' => $encodedData['amountPaid'],
|
||||||
|
],
|
||||||
|
'token' => $encodedData['token']
|
||||||
|
];
|
||||||
|
|
||||||
|
Http::post($this->url, json_encode($data))->throw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,15 +32,22 @@ class ConfirmNoRoadAccessNeedListener implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle(ConfirmNoRoadAccessNeedEvent $event): void
|
public function handle(ConfirmNoRoadAccessNeedEvent $event): void
|
||||||
{
|
{
|
||||||
Http::post($this->url,
|
$encodedData = openssl_decrypt($event->harim->data);
|
||||||
array(
|
|
||||||
'' => $event->harim->id,
|
$data = [
|
||||||
'' => $event->harim->id,
|
'data' => [
|
||||||
'' => $event->harim->id,
|
'actionId' => $encodedData['actionId'],
|
||||||
'' => $event->harim->id,
|
'ruleId' => $encodedData['ruleId'],
|
||||||
'' => $event->harim->id,
|
'activityId' => $encodedData['activityId'],
|
||||||
'' => $event->harim->id,
|
'requestId' => $encodedData['requestId'],
|
||||||
'' => $event->harim->id,
|
'taskId' => $encodedData['taskId'],
|
||||||
))->throw();
|
'code' => $encodedData['code'],
|
||||||
|
'resultStatus' => $encodedData['resultStatus'],
|
||||||
|
'Description' => $encodedData['Description'],
|
||||||
|
],
|
||||||
|
'token' => $encodedData['token']
|
||||||
|
];
|
||||||
|
|
||||||
|
Http::post($this->url, json_encode($data))->throw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,15 +32,22 @@ class ConfirmRoadAccessEditNeedListener implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle(ConfirmRoadAccessEditNeedEvent $event): void
|
public function handle(ConfirmRoadAccessEditNeedEvent $event): void
|
||||||
{
|
{
|
||||||
Http::post($this->url,
|
$encodedData = openssl_decrypt($event->harim->data);
|
||||||
array(
|
|
||||||
'' => $event->harim->id,
|
$data = [
|
||||||
'' => $event->harim->id,
|
'data' => [
|
||||||
'' => $event->harim->id,
|
'actionId' => $encodedData['actionId'],
|
||||||
'' => $event->harim->id,
|
'ruleId' => $encodedData['ruleId'],
|
||||||
'' => $event->harim->id,
|
'activityId' => $encodedData['activityId'],
|
||||||
'' => $event->harim->id,
|
'requestId' => $encodedData['requestId'],
|
||||||
'' => $event->harim->id,
|
'taskId' => $encodedData['taskId'],
|
||||||
))->throw();
|
'code' => $encodedData['code'],
|
||||||
|
'resultStatus' => $encodedData['resultStatus'],
|
||||||
|
'Description' => $encodedData['Description'],
|
||||||
|
],
|
||||||
|
'token' => $encodedData['token']
|
||||||
|
];
|
||||||
|
|
||||||
|
Http::post($this->url, json_encode($data))->throw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,15 +34,22 @@ class ConfirmRoadAccessNeedListener implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle(ConfirmRoadAccessNeedEvent $event): void
|
public function handle(ConfirmRoadAccessNeedEvent $event): void
|
||||||
{
|
{
|
||||||
Http::post($this->url,
|
$encodedData = openssl_decrypt($event->harim->data);
|
||||||
array(
|
|
||||||
'' => $event->harim->id,
|
$data = [
|
||||||
'' => $event->harim->id,
|
'data' => [
|
||||||
'' => $event->harim->id,
|
'actionId' => $encodedData['actionId'],
|
||||||
'' => $event->harim->id,
|
'ruleId' => $encodedData['ruleId'],
|
||||||
'' => $event->harim->id,
|
'activityId' => $encodedData['activityId'],
|
||||||
'' => $event->harim->id,
|
'requestId' => $encodedData['requestId'],
|
||||||
'' => $event->harim->id,
|
'taskId' => $encodedData['taskId'],
|
||||||
))->throw();
|
'code' => $encodedData['code'],
|
||||||
|
'resultStatus' => $encodedData['resultStatus'],
|
||||||
|
'Description' => $encodedData['Description'],
|
||||||
|
],
|
||||||
|
'token' => $encodedData['token']
|
||||||
|
];
|
||||||
|
|
||||||
|
Http::post($this->url, json_encode($data))->throw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,15 +32,22 @@ class RejectRequestListener implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle(RejectRequestEvent $event): void
|
public function handle(RejectRequestEvent $event): void
|
||||||
{
|
{
|
||||||
Http::post($this->url,
|
$encodedData = openssl_decrypt($event->harim->data);
|
||||||
array(
|
|
||||||
'' => $event->harim->id,
|
$data = [
|
||||||
'' => $event->harim->id,
|
'data' => [
|
||||||
'' => $event->harim->id,
|
'actionId' => $encodedData['actionId'],
|
||||||
'' => $event->harim->id,
|
'ruleId' => $encodedData['ruleId'],
|
||||||
'' => $event->harim->id,
|
'activityId' => $encodedData['activityId'],
|
||||||
'' => $event->harim->id,
|
'requestId' => $encodedData['requestId'],
|
||||||
'' => $event->harim->id,
|
'taskId' => $encodedData['taskId'],
|
||||||
))->throw();
|
'code' => $encodedData['code'],
|
||||||
|
'resultStatus' => $encodedData['resultStatus'],
|
||||||
|
'Description' => $encodedData['Description'],
|
||||||
|
],
|
||||||
|
'token' => $encodedData['token']
|
||||||
|
];
|
||||||
|
|
||||||
|
Http::post($this->url, json_encode($data))->throw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user