From: fomichev Date: Wed, 2 Jul 2025 07:50:08 +0000 (+0300) Subject: Проверка на статусы X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=52fbef6394604fb080c17740f836de81cedb251a;p=erp24_rep%2Fyii-erp24%2F.git Проверка на статусы --- diff --git a/erp24/commands/CronController.php b/erp24/commands/CronController.php index 97299e18..86680753 100644 --- a/erp24/commands/CronController.php +++ b/erp24/commands/CronController.php @@ -1746,17 +1746,18 @@ class CronController extends Controller $cache = Yii::$app->cache; $task = $cache->get($cacheKey); - /*if (!$task) { - $scriptLauncherLog = ScriptLauncherLog::find() + $scriptLauncherLog = ScriptLauncherLog::find() ->andWhere(['name' => "taskApRecalculate"]) ->orderBy(['created_at' => SORT_DESC]) ->asArray() ->limit(1) ->one(); - if ($scriptLauncherLog && $scriptLauncherLog['active'] == 1) { - $task = json_decode($scriptLauncherLog['context'], true ); + if ($scriptLauncherLog && $scriptLauncherLog['active'] == 1 && $scriptLauncherLog['status'] == 1) { + //$task = json_decode($scriptLauncherLog['context'], true ); + $this->stdout("Задача уже запущена {$task['startTime']}\n"); + return ExitCode::OK; } - }*/ + //$this->stdout(json_encode($task, JSON_UNESCAPED_UNICODE)); if (!is_array($task) || empty($task['taskName']) || $task['taskName'] !== 'apRecalculateTask') { @@ -1791,6 +1792,7 @@ class CronController extends Controller $log->year = (int)$task['year']; $log->month = (int)$task['month']; $log->active = 1; + $log->status = 1; $log->date_start = date('Y-m-d H:i:s'); if (!$log->save()) { Yii::error(json_encode($log->getErrors(), JSON_UNESCAPED_UNICODE)); @@ -1920,7 +1922,7 @@ class CronController extends Controller $log->progress = 100; $log->active = 0; $log->date_finish = date('Y-m-d H:i:s'); - $log->status = 1; + $log->status = 2; if (!$log->save()) { Yii::error(json_encode($log->getErrors(), JSON_UNESCAPED_UNICODE)); LogService::apiErrorLog(json_encode(["error_id" => 8, "error" => $log->getErrors()], JSON_UNESCAPED_UNICODE)); diff --git a/erp24/web/css/category-plan/style.css b/erp24/web/css/category-plan/style.css index 9be4e0eb..238a55eb 100644 --- a/erp24/web/css/category-plan/style.css +++ b/erp24/web/css/category-plan/style.css @@ -8,7 +8,7 @@ top: 0; left: 0; width: 100%; height: 100%; - background: rgba(255, 255, 255, 0.3); + background: rgba(180, 180, 180, 0.3); z-index: 9999; pointer-events: all; filter: blur(1px);