feat: [hr] 입퇴사자 현황 페이지 구현
- EmployeeService에 근속기간 조회/통계/CSV 내보내기 메서드 추가 - API 컨트롤러에 tenure/tenureExport 엔드포인트 추가 - EmployeeTenureController 뷰 컨트롤러 생성 - 통계 카드 6개 (전체/재직/퇴직/평균근속/올해입사/올해퇴사) - HTMX 테이블 (사원/부서/직책/상태/입사일/퇴사일/근속기간/근속일수) - 필터: 이름검색, 부서, 상태, 입사기간 범위, 정렬 - CSV 엑셀 다운로드 기능
This commit is contained in:
34
app/Http/Controllers/HR/EmployeeTenureController.php
Normal file
34
app/Http/Controllers/HR/EmployeeTenureController.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\HR;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\HR\EmployeeService;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class EmployeeTenureController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private EmployeeService $employeeService
|
||||
) {}
|
||||
|
||||
/**
|
||||
* 입퇴사자 현황 페이지
|
||||
*/
|
||||
public function index(Request $request): View|Response
|
||||
{
|
||||
if ($request->header('HX-Request')) {
|
||||
return response('', 200)->header('HX-Redirect', route('hr.employee-tenure'));
|
||||
}
|
||||
|
||||
$stats = $this->employeeService->getTenureStats();
|
||||
$departments = $this->employeeService->getDepartments();
|
||||
|
||||
return view('hr.employee-tenure.index', [
|
||||
'stats' => $stats,
|
||||
'departments' => $departments,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user