| @@ -54,7 +54,10 @@ class CreateReceiptIssuingOrderController extends HelloTechnoController | |||||
| ->where('customer_code', $param->customerCode) | ->where('customer_code', $param->customerCode) | ||||
| ->firstOrFail(); | ->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) | ->where('parking_management_code', $param->parkingManagementCode) | ||||
| ->firstOrFail(); | ->firstOrFail(); | ||||
| @@ -38,7 +38,9 @@ class ParkingByCodeController extends HelloTechnoController | |||||
| { | { | ||||
| $param = $this->param; | $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) { | if ($parking === null) { | ||||
| throw new AppCommonException("駐車場情報取得不正"); | throw new AppCommonException("駐車場情報取得不正"); | ||||
| @@ -36,7 +36,16 @@ class ParkingsController extends HelloTechnoController | |||||
| { | { | ||||
| $param = $this->param; | $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]); | return $this->successResponse(['records' => $list]); | ||||
| } | } | ||||
| @@ -3,18 +3,21 @@ | |||||
| namespace App\Http\Controllers\Web\Custom\HelloTechno; | namespace App\Http\Controllers\Web\Custom\HelloTechno; | ||||
| use App\Http\Controllers\Web\BaseParam; | use App\Http\Controllers\Web\BaseParam; | ||||
| use App\Util\Custom\HelloTechno\API; | |||||
| /** | /** | ||||
| * @property string $customerCode | |||||
| * @property ?string $customerCode | |||||
| * @property ?string $parkingManagementCode | * @property ?string $parkingManagementCode | ||||
| * @property ?string $parkingName | |||||
| */ | */ | ||||
| class ParkingsParam extends BaseParam | class ParkingsParam extends BaseParam | ||||
| { | { | ||||
| public function rules(): array | public function rules(): array | ||||
| { | { | ||||
| return [ | 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) | |||||
| ]; | ]; | ||||
| } | } | ||||
| } | } | ||||
| @@ -35,7 +35,10 @@ class CacheParkingName extends BaseJob | |||||
| ->where('customer_code', $this->customerCode) | ->where('customer_code', $this->customerCode) | ||||
| ->firstOrFail(); | ->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) | ->where('parking_management_code', $this->parkingManagementCode) | ||||
| ->firstOrFail(); | ->firstOrFail(); | ||||
| @@ -6,6 +6,7 @@ use App\Exceptions\AppCommonException; | |||||
| use App\Models\ReceiptIssuingHTParkingCustomOrder; | use App\Models\ReceiptIssuingHTParkingCustomOrder; | ||||
| use App\Models\ReceiptIssuingOrder; | use App\Models\ReceiptIssuingOrder; | ||||
| use Exception; | use Exception; | ||||
| use Illuminate\Support\Arr; | |||||
| use Illuminate\Support\Carbon; | use Illuminate\Support\Carbon; | ||||
| use Illuminate\Support\Facades\Http; | use Illuminate\Support\Facades\Http; | ||||
| use Illuminate\Support\Facades\Log; | use Illuminate\Support\Facades\Log; | ||||
| @@ -13,6 +14,10 @@ use Illuminate\Support\Facades\Log; | |||||
| class API | 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 = 'result_code'; | ||||
| private const RESULT_CODE_SUCCESS = 'SUCCESS'; | private const RESULT_CODE_SUCCESS = 'SUCCESS'; | ||||
| private const FIELD_DATA = 'data'; | private const FIELD_DATA = 'data'; | ||||
| @@ -35,16 +40,14 @@ class API | |||||
| return static::get(static::getCustomersUrl(), $query); | 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) | public static function getAdjustData(string $customerCode, string $parkingManagementCode, int $adjustSeqNo) | ||||