일일 스크럼 주의 필요 항목 카드 UI 개선
- 주의 필요 항목을 팀별(이슈)/담당자별(태스크) 카드로 그룹핑 - 반응형 그리드 레이아웃 적용 (1~4열) - 펼침 블록에 회사/팀/담당자/프로젝트/마감일 상세 정보 표시 - 조회 조건 변경: 마감 3일 이내 → 이번 주 마감 + 마감 초과 + 긴급 - 헤더 뱃지 "마감임박" → "이번주"로 변경
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Admin\AdminPmDailyLogEntry;
|
||||
use App\Models\Admin\AdminPmIssue;
|
||||
use App\Models\Admin\AdminPmTask;
|
||||
use App\Services\ProjectManagement\DailyLogService;
|
||||
use App\Services\ProjectManagement\ProjectService;
|
||||
use Illuminate\View\View;
|
||||
@@ -29,6 +31,12 @@ public function index(): View
|
||||
$entryStatuses = AdminPmDailyLogEntry::getStatuses();
|
||||
$assignees = $this->dailyLogService->getAssigneeList($tenantId);
|
||||
|
||||
// 주의 필요 이슈 조회 (마감초과, 마감임박, 긴급)
|
||||
$attentionIssues = $this->getAttentionIssues();
|
||||
|
||||
// 주의 필요 태스크 조회 (마감초과, 마감임박, 긴급)
|
||||
$attentionTasks = $this->getAttentionTasks();
|
||||
|
||||
return view('daily-logs.index', compact(
|
||||
'projects',
|
||||
'stats',
|
||||
@@ -36,10 +44,92 @@ public function index(): View
|
||||
'pendingEntries',
|
||||
'assigneeTypes',
|
||||
'entryStatuses',
|
||||
'assignees'
|
||||
'assignees',
|
||||
'attentionIssues',
|
||||
'attentionTasks'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* 주의 필요 이슈 조회
|
||||
* - 마감일 지난 것 (overdue)
|
||||
* - 이번 주 마감 예정 (이번 주 월~일)
|
||||
* - 긴급 표시된 것
|
||||
*/
|
||||
private function getAttentionIssues(): array
|
||||
{
|
||||
$today = now()->startOfDay();
|
||||
$weekEnd = now()->endOfWeek(); // 이번 주 일요일
|
||||
|
||||
$issues = AdminPmIssue::with(['project', 'assignee', 'department'])
|
||||
->whereIn('status', [AdminPmIssue::STATUS_OPEN, AdminPmIssue::STATUS_IN_PROGRESS])
|
||||
->where(function ($q) use ($today, $weekEnd) {
|
||||
// 마감일 지난 것 (overdue)
|
||||
$q->where(function ($q2) use ($today) {
|
||||
$q2->whereNotNull('due_date')
|
||||
->where('due_date', '<', $today);
|
||||
})
|
||||
// 이번 주 마감 예정
|
||||
->orWhere(function ($q2) use ($today, $weekEnd) {
|
||||
$q2->whereNotNull('due_date')
|
||||
->whereBetween('due_date', [$today, $weekEnd]);
|
||||
})
|
||||
// 긴급 표시
|
||||
->orWhere('is_urgent', true);
|
||||
})
|
||||
->orderByRaw("CASE WHEN due_date < CURDATE() THEN 0 ELSE 1 END") // 마감초과 우선
|
||||
->orderBy('is_urgent', 'desc')
|
||||
->orderBy('due_date')
|
||||
->get();
|
||||
|
||||
return [
|
||||
'items' => $issues,
|
||||
'overdue_count' => $issues->filter(fn ($i) => $i->due_status === 'overdue')->count(),
|
||||
'due_soon_count' => $issues->filter(fn ($i) => $i->due_status === 'due_soon' || ($i->due_date && $i->due_date->lte($weekEnd) && $i->due_date->gte($today)))->count(),
|
||||
'urgent_count' => $issues->filter(fn ($i) => $i->is_urgent)->count(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 주의 필요 태스크 조회
|
||||
* - 마감일 지난 것 (overdue)
|
||||
* - 이번 주 마감 예정 (이번 주 월~일)
|
||||
* - 긴급 표시된 것
|
||||
*/
|
||||
private function getAttentionTasks(): array
|
||||
{
|
||||
$today = now()->startOfDay();
|
||||
$weekEnd = now()->endOfWeek(); // 이번 주 일요일
|
||||
|
||||
$tasks = AdminPmTask::with(['project', 'assignee'])
|
||||
->where('status', '!=', AdminPmTask::STATUS_DONE)
|
||||
->where(function ($q) use ($today, $weekEnd) {
|
||||
// 마감일 지난 것 (overdue)
|
||||
$q->where(function ($q2) use ($today) {
|
||||
$q2->whereNotNull('due_date')
|
||||
->where('due_date', '<', $today);
|
||||
})
|
||||
// 이번 주 마감 예정
|
||||
->orWhere(function ($q2) use ($today, $weekEnd) {
|
||||
$q2->whereNotNull('due_date')
|
||||
->whereBetween('due_date', [$today, $weekEnd]);
|
||||
})
|
||||
// 긴급 표시
|
||||
->orWhere('is_urgent', true);
|
||||
})
|
||||
->orderByRaw("CASE WHEN due_date < CURDATE() THEN 0 ELSE 1 END")
|
||||
->orderBy('is_urgent', 'desc')
|
||||
->orderBy('due_date')
|
||||
->get();
|
||||
|
||||
return [
|
||||
'items' => $tasks,
|
||||
'overdue_count' => $tasks->filter(fn ($t) => $t->due_status === 'overdue')->count(),
|
||||
'due_soon_count' => $tasks->filter(fn ($t) => $t->due_date && $t->due_date->lte($weekEnd) && $t->due_date->gte($today))->count(),
|
||||
'urgent_count' => $tasks->filter(fn ($t) => $t->is_urgent)->count(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 일일 로그 상세 화면
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user