feat: [approval] 경력증명서 기안/조회/PDF 기능 추가
- CareerCertService: 사원 경력정보 조회 + TCPDF PDF 생성 - 기안 작성 폼: 사원 선택, 인적/경력/발급 정보, 미리보기 - 상세 조회: 읽기전용 렌더링 + 미리보기/PDF 다운로드 - API: career-cert-info, career-cert-pdf 엔드포인트
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Boards\File;
|
||||
use App\Services\ApprovalService;
|
||||
use App\Services\CareerCertService;
|
||||
use App\Services\EmploymentCertService;
|
||||
use App\Services\GoogleCloudStorageService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@@ -292,6 +293,43 @@ public function certPdf(int $id)
|
||||
return $service->generatePdfResponse($content);
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 경력증명서
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* 사원 경력증명서 정보 조회
|
||||
*/
|
||||
public function careerCertInfo(int $userId): JsonResponse
|
||||
{
|
||||
try {
|
||||
$tenantId = session('selected_tenant_id');
|
||||
$service = app(CareerCertService::class);
|
||||
$data = $service->getCertInfo($userId, $tenantId);
|
||||
|
||||
return response()->json(['success' => true, 'data' => $data]);
|
||||
} catch (\Throwable $e) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => '사원 정보를 불러올 수 없습니다.',
|
||||
], 400);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 경력증명서 PDF 다운로드
|
||||
*/
|
||||
public function careerCertPdf(int $id)
|
||||
{
|
||||
$approval = \App\Models\Approvals\Approval::where('tenant_id', session('selected_tenant_id'))
|
||||
->findOrFail($id);
|
||||
|
||||
$content = $approval->content ?? [];
|
||||
$service = app(CareerCertService::class);
|
||||
|
||||
return $service->generatePdfResponse($content);
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 워크플로우
|
||||
// =========================================================================
|
||||
|
||||
Reference in New Issue
Block a user