crate new project
This commit is contained in:
@@ -35,9 +35,9 @@ class GetMachinesInfoListCommand extends Command
|
||||
|
||||
$updatedRows = 0;
|
||||
|
||||
if (isset($response['vw_MachBankFull'])) {
|
||||
if (isset($response['vw_MachBankFull2'])) {
|
||||
|
||||
foreach ($response['vw_MachBankFull'] as $entry) {
|
||||
foreach ($response['vw_MachBankFull2'] as $entry) {
|
||||
// Insert data into the database
|
||||
CMMSMachine::query()->updateOrCreate(
|
||||
[
|
||||
@@ -54,8 +54,12 @@ class GetMachinesInfoListCommand extends Command
|
||||
'car_id' => $entry['Id'],
|
||||
'unit_group' => $entry['UnitGroup'] == [] ? null : $entry['UnitGroup'],
|
||||
'plak_number' => $entry['PlakNumber'] ?? null,
|
||||
'province_id' => $entry['UnitGroupCode'] ?? null,
|
||||
'city_id' => $entry['UnitCode'] ?? null,
|
||||
'station_id' => $entry['Layer3Code'] ?? null,
|
||||
]);
|
||||
$updatedRows += 1;
|
||||
|
||||
++$updatedRows;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,24 @@ class ConfirmGuaranteeLetterNeedListener implements ShouldQueue
|
||||
*/
|
||||
public function handle(ConfirmGuaranteeLetterNeedEvent $event, SendAccessRoadStatusService $sendAccessRoadStatusService): void
|
||||
{
|
||||
$sendAccessRoadStatusService->makeInputParameters($event->harim->data);
|
||||
|
||||
$arrayData = json_decode($event->harim->data, true);
|
||||
|
||||
$sendAccessRoadStatusService->makeInputParameters([
|
||||
'data' => [
|
||||
'actionId' => $arrayData['actionId'],
|
||||
'ruleId' => $arrayData['ruleId'],
|
||||
'activityId' => $arrayData['activityId'],
|
||||
'requestId' => $arrayData['requestId'],
|
||||
'taskId' => $arrayData['taskId'],
|
||||
'code' => $event->harim->id,
|
||||
'resultStatus' => 1,
|
||||
'Description' => $event->harim->last_description,
|
||||
],
|
||||
|
||||
'token' => $arrayData['token'],
|
||||
]);
|
||||
|
||||
$sendAccessRoadStatusService->run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,24 @@ class ConfirmNoRoadAccessNeedListener implements ShouldQueue
|
||||
*/
|
||||
public function handle(ConfirmNoRoadAccessNeedEvent $event, SendAccessRoadStatusService $sendAccessRoadStatusService): void
|
||||
{
|
||||
$sendAccessRoadStatusService->makeInputParameters($event->harim->data);
|
||||
|
||||
$arrayData = json_decode($event->harim->data, true);
|
||||
|
||||
$sendAccessRoadStatusService->makeInputParameters([
|
||||
'data' => [
|
||||
'actionId' => $arrayData['actionId'],
|
||||
'ruleId' => $arrayData['ruleId'],
|
||||
'activityId' => $arrayData['activityId'],
|
||||
'requestId' => $arrayData['requestId'],
|
||||
'taskId' => $arrayData['taskId'],
|
||||
'code' => $event->harim->id,
|
||||
'resultStatus' => 1,
|
||||
'Description' => $event->harim->last_description,
|
||||
],
|
||||
|
||||
'token' => $arrayData['token'],
|
||||
]);
|
||||
|
||||
$sendAccessRoadStatusService->run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,24 @@ class ConfirmRoadAccessEditNeedListener implements ShouldQueue
|
||||
*/
|
||||
public function handle(ConfirmRoadAccessEditNeedEvent $event, SendAccessRoadStatusService $sendAccessRoadStatusService): void
|
||||
{
|
||||
$sendAccessRoadStatusService->makeInputParameters($event->harim->data);
|
||||
|
||||
$arrayData = json_decode($event->harim->data, true);
|
||||
|
||||
$sendAccessRoadStatusService->makeInputParameters([
|
||||
'data' => [
|
||||
'actionId' => $arrayData['actionId'],
|
||||
'ruleId' => $arrayData['ruleId'],
|
||||
'activityId' => $arrayData['activityId'],
|
||||
'requestId' => $arrayData['requestId'],
|
||||
'taskId' => $arrayData['taskId'],
|
||||
'code' => $event->harim->id,
|
||||
'resultStatus' => 1,
|
||||
'Description' => $event->harim->last_description,
|
||||
],
|
||||
|
||||
'token' => $arrayData['token'],
|
||||
]);
|
||||
|
||||
$sendAccessRoadStatusService->run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Listeners\V3\Dashboard\Harim;
|
||||
|
||||
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessNeedEvent;
|
||||
use App\Models\Harim;
|
||||
use App\Services\PanjarehVahed\SendAccessRoadStatusService;
|
||||
use Exception;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
@@ -25,7 +26,23 @@ class ConfirmRoadAccessNeedListener implements ShouldQueue
|
||||
*/
|
||||
public function handle(ConfirmRoadAccessNeedEvent $event, SendAccessRoadStatusService $sendAccessRoadStatusService): void
|
||||
{
|
||||
$sendAccessRoadStatusService->makeInputParameters($event->harim->data);
|
||||
$arrayData = json_decode($event->harim->data, true);
|
||||
|
||||
$sendAccessRoadStatusService->makeInputParameters([
|
||||
'data' => [
|
||||
'actionId' => $arrayData['actionId'],
|
||||
'ruleId' => $arrayData['ruleId'],
|
||||
'activityId' => $arrayData['activityId'],
|
||||
'requestId' => $arrayData['requestId'],
|
||||
'taskId' => $arrayData['taskId'],
|
||||
'code' => $event->harim->id,
|
||||
'resultStatus' => 1,
|
||||
'Description' => $event->harim->last_description,
|
||||
],
|
||||
|
||||
'token' => $arrayData['token'],
|
||||
]);
|
||||
|
||||
$sendAccessRoadStatusService->run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,24 @@ class PaymentExecutedListener implements ShouldQueue
|
||||
*/
|
||||
public function handle(PaymentExecutedEvent $event, SendPaymentInfoService $sendPaymentInfoService): void
|
||||
{
|
||||
$sendPaymentInfoService->makeInputParameters($event->harim->data);
|
||||
|
||||
$arrayData = json_decode($event->harim->data, true);
|
||||
|
||||
$sendPaymentInfoService->makeInputParameters([
|
||||
'data' => [
|
||||
'actionId' => $arrayData['actionId'],
|
||||
'ruleId' => $arrayData['ruleId'],
|
||||
'activityId' => $arrayData['activityId'],
|
||||
'requestId' => $arrayData['requestId'],
|
||||
'taskId' => $arrayData['taskId'],
|
||||
'code' => $event->harim->id,
|
||||
'warrantStatus' => $event->harim->need_payment ,
|
||||
'amountPaid' => $arrayData['amountPaid'],
|
||||
],
|
||||
|
||||
'token' => $arrayData['token'],
|
||||
]);
|
||||
|
||||
$sendPaymentInfoService->run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,24 @@ class RejectRequestListener implements ShouldQueue
|
||||
*/
|
||||
public function handle(RejectRequestEvent $event, SendAccessRoadStatusService $sendAccessRoadStatusService): void
|
||||
{
|
||||
$sendAccessRoadStatusService->makeInputParameters($event->harim->data);
|
||||
|
||||
$arrayData = json_decode($event->harim->data, true);
|
||||
|
||||
$sendAccessRoadStatusService->makeInputParameters([
|
||||
'data' => [
|
||||
'actionId' => $arrayData['actionId'],
|
||||
'ruleId' => $arrayData['ruleId'],
|
||||
'activityId' => $arrayData['activityId'],
|
||||
'requestId' => $arrayData['requestId'],
|
||||
'taskId' => $arrayData['taskId'],
|
||||
'code' => $event->harim->id,
|
||||
'resultStatus' => 3,
|
||||
'Description' => $event->harim->last_description,
|
||||
],
|
||||
|
||||
'token' => $arrayData['token'],
|
||||
]);
|
||||
|
||||
$sendAccessRoadStatusService->run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,4 +62,11 @@ class Harim extends Model
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
public function latestDescription()
|
||||
{
|
||||
return $this->hasMany(HarimHistory::class)
|
||||
->latestOfMany()
|
||||
->value('expert_description');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,27 +48,11 @@ class SendAccessRoadStatusService
|
||||
->json();
|
||||
}
|
||||
|
||||
public function makeInputParameters($data): void
|
||||
public function makeInputParameters($input): void
|
||||
{
|
||||
$arrayData = json_decode($data, true);
|
||||
|
||||
$inputParameters = [
|
||||
'data' => [
|
||||
'actionId' => $arrayData['actionId'],
|
||||
'ruleId' => $arrayData['ruleId'],
|
||||
'activityId' => $arrayData['activityId'],
|
||||
'requestId' => $arrayData['requestId'],
|
||||
'taskId' => $arrayData['taskId'],
|
||||
'code' => $arrayData['code'],
|
||||
'resultStatus' => $arrayData['resultStatus'],
|
||||
'Description' => $arrayData['Description'],
|
||||
],
|
||||
'token' => $arrayData['token'],
|
||||
];
|
||||
|
||||
$key = config('harim_web_services.Harim_Info.key');
|
||||
$iv = config('harim_web_services.Harim_Info.iv');
|
||||
|
||||
$this->inputParameters = openssl_encrypt(json_encode($inputParameters), 'aes-256-cbc', $key, false, $iv);
|
||||
$this->inputParameters = openssl_encrypt(json_encode($input), 'aes-256-cbc', $key, false, $iv);
|
||||
}
|
||||
}
|
||||
@@ -48,27 +48,11 @@ class SendPaymentInfoService
|
||||
->json();
|
||||
}
|
||||
|
||||
public function makeInputParameters($data): void
|
||||
public function makeInputParameters($input): void
|
||||
{
|
||||
$arrayData = json_decode($data, true);
|
||||
|
||||
$inputParameters = [
|
||||
'data' => [
|
||||
'actionId' => $arrayData['actionId'],
|
||||
'ruleId' => $arrayData['ruleId'],
|
||||
'activityId' => $arrayData['activityId'],
|
||||
'requestId' => $arrayData['requestId'],
|
||||
'taskId' => $arrayData['taskId'],
|
||||
'code' => $arrayData['code'],
|
||||
'warrantStatus' => $arrayData['warrantStatus'],
|
||||
'amountPaid' => $arrayData['amountPaid'],
|
||||
],
|
||||
'token' => $arrayData['token'],
|
||||
];
|
||||
|
||||
$key = config('harim_web_services.Harim_Info.key');
|
||||
$iv = config('harim_web_services.Harim_Info.iv');
|
||||
|
||||
$this->inputParameters = openssl_encrypt(json_encode($inputParameters), 'aes-256-cbc', $key, false, $iv);
|
||||
$this->inputParameters = openssl_encrypt(json_encode($input), 'aes-256-cbc', $key, false, $iv);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('cmms_machines', function (Blueprint $table) {
|
||||
$table->foreignId('province_id')->nullable()->constrained('provinces');
|
||||
$table->foreignId('city_id')->nullable()->constrained('cities');
|
||||
$table->foreignId('station_id')->nullable()->constrained('rahdari_points');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('cmms_machines', function (Blueprint $table) {
|
||||
$table->dropForeign('cmms_machines_province_id_foreign');
|
||||
$table->dropForeign('cmms_machines_city_id_foreign');
|
||||
$table->dropForeign('cmms_machines_station_id_foreign');
|
||||
$table->dropColumn('province_id');
|
||||
$table->dropColumn('city_id');
|
||||
$table->dropColumn('station_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user