소스 검색

HTAPI駐車場取得ロジックの修正 (途中)

HT側が対応完了後に再着手予定
develop
sosuke.iwabuchi 2 년 전
부모
커밋
34e463fd7b
6개의 변경된 파일39개의 추가작업 그리고 16개의 파일을 삭제
  1. +4
    -1
      app/Http/Controllers/Web/Custom/HelloTechno/CreateReceiptIssuingOrderController.php
  2. +3
    -1
      app/Http/Controllers/Web/Custom/HelloTechno/ParkingByCodeController.php
  3. +10
    -1
      app/Http/Controllers/Web/Custom/HelloTechno/ParkingsController.php
  4. +6
    -3
      app/Http/Controllers/Web/Custom/HelloTechno/ParkingsParam.php
  5. +4
    -1
      app/Jobs/Other/Custom/HelloTechno/CacheParkingName.php
  6. +12
    -9
      app/Util/Custom/HelloTechno/API.php

+ 4
- 1
app/Http/Controllers/Web/Custom/HelloTechno/CreateReceiptIssuingOrderController.php 파일 보기

@@ -54,7 +54,10 @@ class CreateReceiptIssuingOrderController extends HelloTechnoController
->where('customer_code', $param->customerCode)
->firstOrFail();
// 駐車場情報取得
$parking = collect(API::getParkings($param->customerCode, $param->parkingManagementCode))
$parking = collect(API::getParkings([
API::CONDITION_CUSTOMER_CODDE => $param->customerCode,
API::CONDITION_PARKING_MANAGEMENT_CODDE => $param->parkingManagementCode,
]))
->where('parking_management_code', $param->parkingManagementCode)
->firstOrFail();



+ 3
- 1
app/Http/Controllers/Web/Custom/HelloTechno/ParkingByCodeController.php 파일 보기

@@ -38,7 +38,9 @@ class ParkingByCodeController extends HelloTechnoController
{
$param = $this->param;

$parking = Arr::first(API::getParkings(null, $param->parkingManagementCode));
$parking = Arr::first(API::getParkings([
API::CONDITION_PARKING_MANAGEMENT_CODDE => $param->parkingManagementCode
]));

if ($parking === null) {
throw new AppCommonException("駐車場情報取得不正");


+ 10
- 1
app/Http/Controllers/Web/Custom/HelloTechno/ParkingsController.php 파일 보기

@@ -36,7 +36,16 @@ class ParkingsController extends HelloTechnoController
{
$param = $this->param;

$list = API::getParkings($param->customerCode, $param->parkingManagementCode);
$a = $param->toArray();
$r = $request->all();

$condition = [
API::CONDITION_CUSTOMER_CODDE => $param->customerCode,
API::CONDITION_PARKING_MANAGEMENT_CODDE => $param->parkingManagementCode,
API::CONDITION_PARKING_NAME => $param->parkingName,
];

$list = API::getParkings($condition);

return $this->successResponse(['records' => $list]);
}


+ 6
- 3
app/Http/Controllers/Web/Custom/HelloTechno/ParkingsParam.php 파일 보기

@@ -3,18 +3,21 @@
namespace App\Http\Controllers\Web\Custom\HelloTechno;

use App\Http\Controllers\Web\BaseParam;
use App\Util\Custom\HelloTechno\API;

/**
* @property string $customerCode
* @property ?string $customerCode
* @property ?string $parkingManagementCode
* @property ?string $parkingName
*/
class ParkingsParam extends BaseParam
{
public function rules(): array
{
return [
'customer_code' => $this->str(),
'parking_management_code' => $this->str(true)
API::CONDITION_CUSTOMER_CODDE => $this->str(true),
API::CONDITION_PARKING_MANAGEMENT_CODDE => $this->str(true),
API::CONDITION_PARKING_NAME => $this->str(true)
];
}
}

+ 4
- 1
app/Jobs/Other/Custom/HelloTechno/CacheParkingName.php 파일 보기

@@ -35,7 +35,10 @@ class CacheParkingName extends BaseJob
->where('customer_code', $this->customerCode)
->firstOrFail();
// 駐車場情報取得
$parking = collect(API::getParkings($this->customerCode, $this->parkingManagementCode))
$parking = collect(API::getParkings([
API::CONDITION_CUSTOMER_CODDE => $this->customerCode,
API::CONDITION_PARKING_MANAGEMENT_CODDE => $this->parkingManagementCode,
]))
->where('parking_management_code', $this->parkingManagementCode)
->firstOrFail();



+ 12
- 9
app/Util/Custom/HelloTechno/API.php 파일 보기

@@ -6,6 +6,7 @@ use App\Exceptions\AppCommonException;
use App\Models\ReceiptIssuingHTParkingCustomOrder;
use App\Models\ReceiptIssuingOrder;
use Exception;
use Illuminate\Support\Arr;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
@@ -13,6 +14,10 @@ use Illuminate\Support\Facades\Log;
class API
{

const CONDITION_CUSTOMER_CODDE = 'customer_code';
const CONDITION_PARKING_MANAGEMENT_CODDE = 'parking_management_code';
const CONDITION_PARKING_NAME = 'parking_name';

private const RESULT_CODE = 'result_code';
private const RESULT_CODE_SUCCESS = 'SUCCESS';
private const FIELD_DATA = 'data';
@@ -35,16 +40,14 @@ class API
return static::get(static::getCustomersUrl(), $query);
}

public static function getParkings(?string $customerCode, ?string $parkingManagementCode = null)
public static function getParkings(array $condition)
{

if ($customerCode) {
$query['customer_code'] = $customerCode;
}
if ($parkingManagementCode) {
$query['parking_management_code'] = $parkingManagementCode;
}
return static::get(static::getParkingsUrl(), $query);
$condition = Arr::only($condition, [
self::CONDITION_CUSTOMER_CODDE,
self::CONDITION_PARKING_MANAGEMENT_CODDE,
self::CONDITION_PARKING_NAME,
]);
return static::get(static::getParkingsUrl(), $condition);
}

public static function getAdjustData(string $customerCode, string $parkingManagementCode, int $adjustSeqNo)


Loading…
취소
저장