Files
crm.clientright.ru/Send2Court.php
Fedor ac7467f0b4 Major CRM updates: AI Assistant, Court Status API, S3 integration improvements, and extensive file storage system
- Added comprehensive AI Assistant system (aiassist/ directory):
  * Vector search and embedding capabilities
  * Typebot proxy integration
  * Elastic search functionality
  * Message classification and chat history
  * MCP proxy for external integrations

- Implemented Court Status API (GetCourtStatus.php):
  * Real-time court document status checking
  * Integration with external court systems
  * Comprehensive error handling and logging

- Enhanced S3 integration:
  * Improved file backup system with metadata
  * Batch processing capabilities
  * Enhanced error logging and recovery
  * Copy operations with URL fixing

- Added Telegram contact creation API
- Improved error logging across all modules
- Enhanced callback system for AI responses
- Extensive backup file storage with timestamps
- Updated documentation and README files

- File storage improvements:
  * Thousands of backup files with proper metadata
  * Fix operations for broken file references
  * Project-specific backup and recovery systems
  * Comprehensive file integrity checking

Total: 26,461+ files added/modified including AWS SDK, vendor dependencies, and extensive backup system.
2025-10-16 11:17:21 +03:00

59 lines
2.5 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
file_put_contents('send2court.log', date('Y-m-d H:i:s').' - старт корневой процедуры отправки исковых'.PHP_EOL, FILE_APPEND);
set_time_limit(0); //Снимаем ограничение по времени работы скрипта
error_reporting(E_ALL);
ini_set('display_errors', '1');
$id = $_REQUEST['id'] ?? $_REQUEST['projectid'];
$processType = $_REQUEST['type'] ?? $_REQUEST['processType'];
$version = $_REQUEST['version'];
require_once 'include/utils/Debexpert-guzzle.php';
require_once 'include/utils/utils.php';
if (empty($processType)) {
$processType = '201.01';
}
if (isset($id) and !empty($id) and $id > 0) {
// Задан ID конкретного Проекта - его и отправим
$result = Send2Court($id, $processType, $version);
if (is_array($result)) {
// Завершилось относительно ровно, в том плане, что логических ошибок не найдено, которые прервали бы процесс
$result = json_encode($result);
}
file_put_contents('logs/send2court.log', date('Y-m-d H:i:s').' - в WD возвращаем ответ: '.$result.PHP_EOL, FILE_APPEND);
echo $result;
} else {
// Конкретный Проект не задан - значит отправим все
global $adb;
$query = 'select p.projectid
from vtiger_project p
left join vtiger_crmentity e on e.crmid = p.projectid
left join vtiger_projectcf cf on cf.projectid = p.projectid
where e.deleted = 0 and p.projectstatus = "готово для подачи" and cf.cf_1501 not like "%Москва%" and cf.cf_1501 not like "%москва%"';
$result = $adb->pquery($query);
$count = $adb->num_rows($result);
if ($count > 0) {
file_put_contents('logs/send2court.log', date('Y-m-d H:i:s').' - найдено '.$count.' Проектов на отправку в суд'.PHP_EOL, FILE_APPEND);
// Есть Проекты на отправку
for ($i=0; $i<$count; $i++) {
$id = $adb->query_result($result, $i, 'projectid');
if ($i > 0) {
// Пауза между отправками
sleep(10);
}
$out = Send2Court($id, $processType, $version);
}
file_put_contents('logs/send2court.log', date('Y-m-d H:i:s').' - закончили отправку всех исковых'.PHP_EOL, FILE_APPEND);
} else {
file_put_contents('logs/send2court.log', date('Y-m-d H:i:s').' - Проектов на отправку в суд не обнаружено'.PHP_EOL, FILE_APPEND);
}
}
?>