Added mail logic for immediate laser stopped alert
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 22s
Laravel Pint / pint (pull_request) Successful in 3m2s
Laravel Larastan / larastan (pull_request) Failing after 7m7s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 22s
Laravel Pint / pint (pull_request) Successful in 3m2s
Laravel Larastan / larastan (pull_request) Failing after 7m7s
This commit is contained in:
@@ -394,11 +394,89 @@ class Scheduler extends Command
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//..Laser Stop Report
|
||||
$laserStopReport = AlertMailRule::where('module', 'LaserStopAlert')
|
||||
->where('rule_name', 'LaserStopAlertMail')
|
||||
->select('plant', 'schedule_type', 'machine_id')
|
||||
->distinct()
|
||||
->get();
|
||||
|
||||
foreach ($laserStopReport as $rule) {
|
||||
switch ($rule->schedule_type) {
|
||||
case 'Live':
|
||||
// Run every minute
|
||||
\Artisan::call('send:laser-stop-report', [
|
||||
'schedule_type' => $rule->schedule_type,
|
||||
'plant' => $rule->plant,
|
||||
'machine_id' => $rule->machine_id,
|
||||
]);
|
||||
break;
|
||||
case 'Hourly':
|
||||
if (now()->minute == 0) {
|
||||
\Artisan::call('send:laser-stop-report', [
|
||||
'schedule_type' => $rule->schedule_type,
|
||||
'plant' => $rule->plant,
|
||||
'machine_id' => $rule->machine_id,
|
||||
]);
|
||||
}
|
||||
break;
|
||||
case 'Daily':
|
||||
if (now()->format('H:i') == '07:59') {
|
||||
\Artisan::call('send:laser-stop-report', [
|
||||
'schedule_type' => $rule->schedule_type,
|
||||
'plant' => $rule->plant,
|
||||
'machine_id' => $rule->machine_id,
|
||||
]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//..Laser Stop Final Report
|
||||
|
||||
// $laserStopFinalReport = AlertMailRule::where('module', 'LaserStopReport')
|
||||
// ->where('rule_name', 'LaserStopMail')
|
||||
// ->select('plant', 'schedule_type', 'machine_id')
|
||||
// ->distinct()
|
||||
// ->get();
|
||||
|
||||
// foreach ($laserStopFinalReport as $rule) {
|
||||
// switch ($rule->schedule_type) {
|
||||
// case 'Live':
|
||||
// // Run every minute
|
||||
// \Artisan::call('send:laser-stop-consolidate-report', [
|
||||
// 'schedule_type' => $rule->schedule_type,
|
||||
// 'plant' => $rule->plant,
|
||||
// 'machine_id' => $rule->machine_id,
|
||||
// ]);
|
||||
// break;
|
||||
// case 'Hourly':
|
||||
// if (now()->minute == 0) {
|
||||
// \Artisan::call('send:laser-stop-consolidate-report', [
|
||||
// 'schedule_type' => $rule->schedule_type,
|
||||
// 'plant' => $rule->plant,
|
||||
// 'machine_id' => $rule->machine_id,
|
||||
// ]);
|
||||
// }
|
||||
// break;
|
||||
// case 'Daily':
|
||||
// if (now()->format('H:i') == '07:59') {
|
||||
// \Artisan::call('send:laser-stop-consolidate-report', [
|
||||
// 'schedule_type' => $rule->schedule_type,
|
||||
// 'plant' => $rule->plant,
|
||||
// 'machine_id' => $rule->machine_id,
|
||||
// ]);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to call Artisan commands with parameters.
|
||||
*/
|
||||
*/
|
||||
protected function callArtisanCommand($commandName, $rule)
|
||||
{
|
||||
\Artisan::call($commandName, [
|
||||
|
||||
Reference in New Issue
Block a user