|
@@ -2188,6 +2188,7 @@ class BiAuditPowiazania {
|
|
|
private $splittedResults = [];
|
|
private $splittedResults = [];
|
|
|
private $maxResults = 1000000;
|
|
private $maxResults = 1000000;
|
|
|
private $fidRow = [];
|
|
private $fidRow = [];
|
|
|
|
|
+ private $pracownikID = 0;
|
|
|
|
|
|
|
|
private static function generateJson($type, $data) {
|
|
private static function generateJson($type, $data) {
|
|
|
return json_encode(['ts' => microtime(true), 'type' => $type, 'data' => $data]);
|
|
return json_encode(['ts' => microtime(true), 'type' => $type, 'data' => $data]);
|
|
@@ -2217,10 +2218,10 @@ class BiAuditPowiazania {
|
|
|
$this->lastTimestamp = $timestamp;
|
|
$this->lastTimestamp = $timestamp;
|
|
|
$progressJson = self::generateJson('progress', ['progress' => $progress, 'item' => $this->i . "/" . $this->count, 'results' => count($this->results), 'step' => $this->step, 'elapsed' => $elapsed, 'estimated' => $estimated]);
|
|
$progressJson = self::generateJson('progress', ['progress' => $progress, 'item' => $this->i . "/" . $this->count, 'results' => count($this->results), 'step' => $this->step, 'elapsed' => $elapsed, 'estimated' => $estimated]);
|
|
|
echo $progressJson . "\n";
|
|
echo $progressJson . "\n";
|
|
|
- $this->progress[$this->i] = ['progress' => $progress, 'results' => (count($this->results) - $this->lastResults), 'elapsed' => $elapsed, 'estimated' => $estimated];
|
|
|
|
|
|
|
+ $this->progress['details'][$this->pracownikID] = ['progress' => $progress, 'results' => (count($this->results) - $this->lastResults), 'elapsed' => $elapsed, 'estimated' => $estimated];
|
|
|
}
|
|
}
|
|
|
- if ($message !== null) $this->progress[0]['message'] = $message;
|
|
|
|
|
- $this->progress[0]['ts'] = $timestamp;
|
|
|
|
|
|
|
+ if ($message !== null) $this->progress['summary']['message'] = $message;
|
|
|
|
|
+ $this->progress['summary']['ts'] = $timestamp;
|
|
|
file_put_contents($this->progressFile, json_encode($this->progress));
|
|
file_put_contents($this->progressFile, json_encode($this->progress));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2270,12 +2271,13 @@ class BiAuditPowiazania {
|
|
|
on `all`.REMOTE_TABLE = 'BI_audit_ENERGA_PRACOWNICY' and `all`.REMOTE_ID = ref.REMOTE_PRIMARY_KEY and ref.PRIMARY_KEY = '{$this->ID}' order by `all`.`ID` asc";
|
|
on `all`.REMOTE_TABLE = 'BI_audit_ENERGA_PRACOWNICY' and `all`.REMOTE_ID = ref.REMOTE_PRIMARY_KEY and ref.PRIMARY_KEY = '{$this->ID}' order by `all`.`ID` asc";
|
|
|
$result = DB::getPDO()->fetchAll($query);
|
|
$result = DB::getPDO()->fetchAll($query);
|
|
|
$this->count = count($result);
|
|
$this->count = count($result);
|
|
|
- $this->progress[0]['count'] = $this->count;
|
|
|
|
|
|
|
+ $this->progress['summary']['count'] = $this->count;
|
|
|
$this->origMaxDepth = $this->maxDepth;
|
|
$this->origMaxDepth = $this->maxDepth;
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
foreach ($result as $i => $row) {
|
|
foreach ($result as $i => $row) {
|
|
|
$this->i = $i + 1;
|
|
$this->i = $i + 1;
|
|
|
|
|
+ $this->pracownikID = $row['ID'];
|
|
|
$this->startTimestamp = microtime(true);
|
|
$this->startTimestamp = microtime(true);
|
|
|
$this->lastProgress = 0;
|
|
$this->lastProgress = 0;
|
|
|
$this->saveProgress(0, "Wyszukiwanie powiązań dla obiektu {$this->i}/{$this->count}");
|
|
$this->saveProgress(0, "Wyszukiwanie powiązań dla obiektu {$this->i}/{$this->count}");
|