Merge pull request #69 from witelgroup/feature/WebserviceResive

change format for fill column harim
This commit is contained in:
Amir Ghasempoor
2025-10-18 10:45:16 +03:30
committed by GitHub
7 changed files with 130 additions and 81 deletions

View File

@@ -71,23 +71,23 @@ FMS_ERROR_RATE_URL=
FMS_ERROR_RATE_PASSWORD=
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_USERNAME=
HARIM_REJECT_URL=
HARIM_REJECT_URL='https://zamin.gov.ir/ow/api/ow/esb/response'
HARIM_REJECT_PASSWORD=
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_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_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_USERNAME=

View File

@@ -12,13 +12,14 @@ use App\Http\Traits\ApiResponse;
use App\Models\City;
use App\Models\Harim;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\DB;
class PanjareVahedController extends Controller
{
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'])) . '))';
$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;
Harim::query()->create([
$harim = Harim::query()->create([
'state_id' => $state,
'state_name' => HarimStates::name($state),
'panjare_vahed_id' => $request->request_id,
@@ -66,55 +67,68 @@ class PanjareVahedController extends Controller
'token' => $request->data['token'],
]);
return $this->successResponse([
return response()->json([
'id' => $harim->id,
'city' => $city->edarateShahri()->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;
Harim::query()
->firstWhere('panjare_vahed_id', '=', $request->request_id)
->update([
$harim = Harim::query()->firstWhere('panjare_vahed_id', '=', $request->request_id);
$harim->update([
'state_id' => $state,
'state_name' => HarimStates::name($state),
'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;
Harim::query()
->firstWhere('panjare_vahed_id', '=', $request->request_id)
->update([
'state_id' => $state,
'state_name' => HarimStates::name($state),
]);
$harim = Harim::query()->firstWhere('panjare_vahed_id', '=', $request->request_id);
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;
Harim::query()
->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),
]);
$harim = Harim::query()->firstWhere('panjare_vahed_id', '=', $request->request_id);
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,
]);
}
}

View File

@@ -32,15 +32,22 @@ class ConfirmGuaranteeLetterNeedListener implements ShouldQueue
*/
public function handle(ConfirmGuaranteeLetterNeedEvent $event): void
{
Http::post($this->url,
array(
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
))->throw();
$encodedData = openssl_decrypt($event->harim->data);
$data = [
'data' => [
'actionId' => $encodedData['actionId'],
'ruleId' => $encodedData['ruleId'],
'activityId' => $encodedData['activityId'],
'requestId' => $encodedData['requestId'],
'taskId' => $encodedData['taskId'],
'code' => $encodedData['code'],
'warrantStatus' => $encodedData['warrantStatus'],
'amountPaid' => $encodedData['amountPaid'],
],
'token' => $encodedData['token']
];
Http::post($this->url, json_encode($data))->throw();
}
}

View File

@@ -32,15 +32,22 @@ class ConfirmNoRoadAccessNeedListener implements ShouldQueue
*/
public function handle(ConfirmNoRoadAccessNeedEvent $event): void
{
Http::post($this->url,
array(
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
))->throw();
$encodedData = openssl_decrypt($event->harim->data);
$data = [
'data' => [
'actionId' => $encodedData['actionId'],
'ruleId' => $encodedData['ruleId'],
'activityId' => $encodedData['activityId'],
'requestId' => $encodedData['requestId'],
'taskId' => $encodedData['taskId'],
'code' => $encodedData['code'],
'resultStatus' => $encodedData['resultStatus'],
'Description' => $encodedData['Description'],
],
'token' => $encodedData['token']
];
Http::post($this->url, json_encode($data))->throw();
}
}

View File

@@ -32,15 +32,22 @@ class ConfirmRoadAccessEditNeedListener implements ShouldQueue
*/
public function handle(ConfirmRoadAccessEditNeedEvent $event): void
{
Http::post($this->url,
array(
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
))->throw();
$encodedData = openssl_decrypt($event->harim->data);
$data = [
'data' => [
'actionId' => $encodedData['actionId'],
'ruleId' => $encodedData['ruleId'],
'activityId' => $encodedData['activityId'],
'requestId' => $encodedData['requestId'],
'taskId' => $encodedData['taskId'],
'code' => $encodedData['code'],
'resultStatus' => $encodedData['resultStatus'],
'Description' => $encodedData['Description'],
],
'token' => $encodedData['token']
];
Http::post($this->url, json_encode($data))->throw();
}
}

View File

@@ -34,15 +34,22 @@ class ConfirmRoadAccessNeedListener implements ShouldQueue
*/
public function handle(ConfirmRoadAccessNeedEvent $event): void
{
Http::post($this->url,
array(
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
))->throw();
$encodedData = openssl_decrypt($event->harim->data);
$data = [
'data' => [
'actionId' => $encodedData['actionId'],
'ruleId' => $encodedData['ruleId'],
'activityId' => $encodedData['activityId'],
'requestId' => $encodedData['requestId'],
'taskId' => $encodedData['taskId'],
'code' => $encodedData['code'],
'resultStatus' => $encodedData['resultStatus'],
'Description' => $encodedData['Description'],
],
'token' => $encodedData['token']
];
Http::post($this->url, json_encode($data))->throw();
}
}

View File

@@ -32,15 +32,22 @@ class RejectRequestListener implements ShouldQueue
*/
public function handle(RejectRequestEvent $event): void
{
Http::post($this->url,
array(
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
'' => $event->harim->id,
))->throw();
$encodedData = openssl_decrypt($event->harim->data);
$data = [
'data' => [
'actionId' => $encodedData['actionId'],
'ruleId' => $encodedData['ruleId'],
'activityId' => $encodedData['activityId'],
'requestId' => $encodedData['requestId'],
'taskId' => $encodedData['taskId'],
'code' => $encodedData['code'],
'resultStatus' => $encodedData['resultStatus'],
'Description' => $encodedData['Description'],
],
'token' => $encodedData['token']
];
Http::post($this->url, json_encode($data))->throw();
}
}