summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/[lng]/evcp/(evcp)/consent/page.tsx (renamed from app/[lng]/evcp/(evcp)/polices/page.tsx)2
-rw-r--r--app/[lng]/evcp/(evcp)/pq_new/[vendorId]/[submissionId]/page.tsx19
-rw-r--r--app/[lng]/procurement/(procurement)/pq_new/[vendorId]/[submissionId]/page.tsx19
-rw-r--r--app/api/basic-contract/get-template/route.ts31
4 files changed, 37 insertions, 34 deletions
diff --git a/app/[lng]/evcp/(evcp)/polices/page.tsx b/app/[lng]/evcp/(evcp)/consent/page.tsx
index 46a9e87a..5e760b5e 100644
--- a/app/[lng]/evcp/(evcp)/polices/page.tsx
+++ b/app/[lng]/evcp/(evcp)/consent/page.tsx
@@ -71,7 +71,7 @@ export default async function PoliciesPage() {
{/* 헤더 */}
<div className="flex items-center justify-between">
<div>
- <h1 className="text-3xl font-bold tracking-tight">정책 관리</h1>
+ <h2 className="text-2xl font-bold tracking-tight">정책 관리</h2>
<p className="text-muted-foreground">
개인정보 처리방침과 이용약관을 버전별로 관리합니다
</p>
diff --git a/app/[lng]/evcp/(evcp)/pq_new/[vendorId]/[submissionId]/page.tsx b/app/[lng]/evcp/(evcp)/pq_new/[vendorId]/[submissionId]/page.tsx
index bd8d2347..c8b0e9b8 100644
--- a/app/[lng]/evcp/(evcp)/pq_new/[vendorId]/[submissionId]/page.tsx
+++ b/app/[lng]/evcp/(evcp)/pq_new/[vendorId]/[submissionId]/page.tsx
@@ -12,6 +12,7 @@ import { Separator } from "@/components/ui/separator"
import { getPQById, getPQDataByVendorId } from "@/lib/pq/service"
import { unstable_noStore as noStore } from 'next/cache'
import { PQReviewWrapper } from "@/components/pq-input/pq-review-wrapper"
+import { formatDate } from "@/lib/utils"
export const metadata: Metadata = {
title: "PQ 검토",
@@ -93,7 +94,7 @@ export default async function PQReviewPage(props: PQReviewPageProps) {
<Alert>
<AlertTitle>제출 완료</AlertTitle>
<AlertDescription>
- 협력업체가 {formatDate(pqSubmission.submittedAt)}에 PQ를 제출했습니다. 검토 후 승인 또는 거부할 수 있습니다.
+ 협력업체가 {formatDate(pqSubmission.submittedAt, "kr")}에 PQ를 제출했습니다. 검토 후 승인 또는 거부할 수 있습니다.
</AlertDescription>
</Alert>
)}
@@ -102,7 +103,7 @@ export default async function PQReviewPage(props: PQReviewPageProps) {
<Alert variant="success">
<AlertTitle>승인됨</AlertTitle>
<AlertDescription>
- {formatDate(pqSubmission.approvedAt)}에 승인되었습니다.
+ {formatDate(pqSubmission.approvedAt, "kr")}에 승인되었습니다.
</AlertDescription>
</Alert>
)}
@@ -111,7 +112,7 @@ export default async function PQReviewPage(props: PQReviewPageProps) {
<Alert variant="destructive">
<AlertTitle>거부됨</AlertTitle>
<AlertDescription>
- {formatDate(pqSubmission.rejectedAt)}에 거부되었습니다.
+ {formatDate(pqSubmission.rejectedAt, "kr")}에 거부되었습니다.
{pqSubmission.rejectReason && (
<div className="mt-2">
<strong>사유:</strong> {pqSubmission.rejectReason}
@@ -202,16 +203,4 @@ function getStatusVariant(status: string): "default" | "outline" | "secondary" |
default:
return "outline";
}
-}
-
-// 날짜 형식화 함수
-function formatDate(date: Date | null) {
- if (!date) return "날짜 없음";
- return new Date(date).toLocaleDateString("ko-KR", {
- year: "numeric",
- month: "long",
- day: "numeric",
- hour: "2-digit",
- minute: "2-digit"
- });
} \ No newline at end of file
diff --git a/app/[lng]/procurement/(procurement)/pq_new/[vendorId]/[submissionId]/page.tsx b/app/[lng]/procurement/(procurement)/pq_new/[vendorId]/[submissionId]/page.tsx
index b82075e9..b4b51363 100644
--- a/app/[lng]/procurement/(procurement)/pq_new/[vendorId]/[submissionId]/page.tsx
+++ b/app/[lng]/procurement/(procurement)/pq_new/[vendorId]/[submissionId]/page.tsx
@@ -12,6 +12,7 @@ import { Separator } from "@/components/ui/separator"
import { getPQById, getPQDataByVendorId } from "@/lib/pq/service"
import { unstable_noStore as noStore } from 'next/cache'
import { PQReviewWrapper } from "@/components/pq-input/pq-review-wrapper"
+import { formatDate } from "@/lib/utils"
export const metadata: Metadata = {
title: "PQ 검토",
@@ -93,7 +94,7 @@ export default async function PQReviewPage(props: PQReviewPageProps) {
<Alert>
<AlertTitle>제출 완료</AlertTitle>
<AlertDescription>
- 협력업체가 {formatDate(pqSubmission.submittedAt)}에 PQ를 제출했습니다. 검토 후 승인 또는 거부할 수 있습니다.
+ 협력업체가 {formatDate(pqSubmission.submittedAt, "kr")}에 PQ를 제출했습니다. 검토 후 승인 또는 거부할 수 있습니다.
</AlertDescription>
</Alert>
)}
@@ -102,7 +103,7 @@ export default async function PQReviewPage(props: PQReviewPageProps) {
<Alert variant="success">
<AlertTitle>승인됨</AlertTitle>
<AlertDescription>
- {formatDate(pqSubmission.approvedAt)}에 승인되었습니다.
+ {formatDate(pqSubmission.approvedAt, "kr")}에 승인되었습니다.
</AlertDescription>
</Alert>
)}
@@ -111,7 +112,7 @@ export default async function PQReviewPage(props: PQReviewPageProps) {
<Alert variant="destructive">
<AlertTitle>거부됨</AlertTitle>
<AlertDescription>
- {formatDate(pqSubmission.rejectedAt)}에 거부되었습니다.
+ {formatDate(pqSubmission.rejectedAt, "kr")}에 거부되었습니다.
{pqSubmission.rejectReason && (
<div className="mt-2">
<strong>사유:</strong> {pqSubmission.rejectReason}
@@ -202,16 +203,4 @@ function getStatusVariant(status: string): "default" | "outline" | "secondary" |
default:
return "outline";
}
-}
-
-// 날짜 형식화 함수
-function formatDate(date: Date | null) {
- if (!date) return "날짜 없음";
- return new Date(date).toLocaleDateString("ko-KR", {
- year: "numeric",
- month: "long",
- day: "numeric",
- hour: "2-digit",
- minute: "2-digit"
- });
} \ No newline at end of file
diff --git a/app/api/basic-contract/get-template/route.ts b/app/api/basic-contract/get-template/route.ts
index 111532f0..ad30ae89 100644
--- a/app/api/basic-contract/get-template/route.ts
+++ b/app/api/basic-contract/get-template/route.ts
@@ -26,8 +26,27 @@ export async function POST(request: NextRequest) {
return NextResponse.json({ error: '템플릿 파일 경로가 없습니다.' }, { status: 404 });
}
- // 파일 시스템에서 파일 읽기
- const fullPath = path.join(process.cwd(), "public", template.filePath);
+ // 환경에 따른 파일 경로 설정
+ let fullPath: string;
+
+ if (process.env.NODE_ENV === 'production') {
+ // production: NAS 경로 사용
+ const nasPath = process.env.NAS_PATH || "/evcp_nas";
+ // template.filePath가 /api/files/로 시작하는 경우 제거하고 basicContract로 시작하도록 정리
+ const cleanPath = template.filePath.startsWith('/api/files/')
+ ? template.filePath.replace('/api/files/', '')
+ : template.filePath.startsWith('/')
+ ? template.filePath.slice(1)
+ : template.filePath;
+ fullPath = path.join(nasPath, cleanPath);
+ } else {
+ // development: public 폴더 사용
+ // template.filePath에서 앞의 슬래시를 제거
+ const cleanPath = template.filePath.startsWith('/') ? template.filePath.slice(1) : template.filePath;
+ fullPath = path.join(process.cwd(), "public", cleanPath);
+ }
+
+ console.log(`📁 템플릿 파일 경로: ${fullPath} (환경: ${process.env.NODE_ENV})`);
try {
const fileBuffer = await fs.readFile(fullPath);
@@ -42,7 +61,13 @@ export async function POST(request: NextRequest) {
});
} catch (fileError) {
console.error('파일 읽기 오류:', fileError);
- return NextResponse.json({ error: '템플릿 파일을 읽을 수 없습니다.' }, { status: 500 });
+ console.error(`파일 경로: ${fullPath}`);
+ console.error(`template.filePath: ${template.filePath}`);
+ return NextResponse.json({
+ error: '템플릿 파일을 읽을 수 없습니다.',
+ details: `파일 경로: ${fullPath}`,
+ originalPath: template.filePath
+ }, { status: 500 });
}
} catch (error) {