| @@ -7,6 +7,7 @@ use App\Codes\Model\QRServiceUsage; | |||||
| use App\Exceptions\AppCommonException; | use App\Exceptions\AppCommonException; | ||||
| use App\Models\HtpmsCustomer\Mst\ShopNoRelation; | use App\Models\HtpmsCustomer\Mst\ShopNoRelation; | ||||
| use App\Models\HtpmsCustomer\QRService\PrintTicket; | use App\Models\HtpmsCustomer\QRService\PrintTicket; | ||||
| use App\Sessions\SessionUser; | |||||
| use Illuminate\Support\Carbon; | use Illuminate\Support\Carbon; | ||||
| class PrintingLogic | class PrintingLogic | ||||
| @@ -37,12 +38,22 @@ class PrintingLogic | |||||
| ) { | ) { | ||||
| // 重複利用チェック | // 重複利用チェック | ||||
| if (PrintTicket::wherePublishingTerminalCode($adjusterTerminalCode) | |||||
| $used = PrintTicket::wherePublishingTerminalCode($adjusterTerminalCode) | |||||
| ->wherePublishingDate($publishingDate) | ->wherePublishingDate($publishingDate) | ||||
| ->wherePublishingNo($seqNo) | ->wherePublishingNo($seqNo) | ||||
| ->exists() | |||||
| ) { | |||||
| throw new AppCommonException("利用済み"); | |||||
| ->first(); | |||||
| if ($used !== null) { | |||||
| $user = SessionUser::instance(); | |||||
| $message = sprintf( | |||||
| "利用済み customer_code:%s parking_management_code:%s terminal:%s date:%s no:%d used_at:%s", | |||||
| $user->customerCode(), | |||||
| $parkingManagementCode, | |||||
| $adjusterTerminalCode, | |||||
| $publishingDate->format('Y/m/d'), | |||||
| $seqNo, | |||||
| $used->used_at->format('Y/m/d H:i:s') | |||||
| ); | |||||
| throw new AppCommonException($message); | |||||
| } | } | ||||
| // 店舗特定 | // 店舗特定 | ||||