|
|
|
|
@ -86,12 +86,26 @@ class RetryInvalidTimeCourseCarAppointments extends Command
|
|
|
|
|
|
|
|
|
|
// 仓库会记录新的请求、响应和第三方订单号;仅补发车位,不发送门禁或通知。
|
|
|
|
|
$out = null;
|
|
|
|
|
if ((new CarRepository())->courseAppointment($course, $sign, $plate, $out)) {
|
|
|
|
|
$sentAt = microtime(true);
|
|
|
|
|
$result = (new CarRepository())->courseAppointment($course, $sign, $plate, $out, function ($request) {
|
|
|
|
|
$seconds = (int) floor($request['ts'] / 1000);
|
|
|
|
|
$this->line('本次请求 reqId:' . $request['reqId']);
|
|
|
|
|
$this->line('本次请求 ts(毫秒):' . sprintf('%.0f', $request['ts']));
|
|
|
|
|
$this->line('请求时间(北京时间):' . (new \DateTimeImmutable('@' . $seconds))
|
|
|
|
|
->setTimezone(new \DateTimeZone('Asia/Shanghai'))->format('Y-m-d H:i:s P'));
|
|
|
|
|
$this->line('请求时间(UTC):' . gmdate('Y-m-d H:i:s', $seconds) . ' UTC');
|
|
|
|
|
foreach (['enterTime', 'leaveTime', 'failureTime'] as $field) {
|
|
|
|
|
$this->line($field . ':' . $request[$field]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$this->line('请求及日志处理耗时(秒):' . number_format(microtime(true) - $sentAt, 3, '.', ''));
|
|
|
|
|
$this->output->writeln('本次接口返回:' . ((string) $out !== '' ? (string) $out : '(空响应)'), \Symfony\Component\Console\Output\OutputInterface::OUTPUT_RAW);
|
|
|
|
|
if ($result) {
|
|
|
|
|
$success++;
|
|
|
|
|
$this->info('补发成功');
|
|
|
|
|
} else {
|
|
|
|
|
$failed++;
|
|
|
|
|
$this->error('补发失败,请查看该报名的新第三方预约日志');
|
|
|
|
|
$this->error('补发失败(接口返回或请求异常见上方)');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|