summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.env.development7
-rw-r--r--.env.production4
-rw-r--r--app/[lng]/partners/(partners)/document-list-ship/page.tsx4
-rw-r--r--lib/vendor-document-list/dolce-upload-service.ts1
-rw-r--r--lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx34
5 files changed, 39 insertions, 11 deletions
diff --git a/.env.development b/.env.development
index 58fe1acf..2d59cd4c 100644
--- a/.env.development
+++ b/.env.development
@@ -43,17 +43,21 @@ ORACLE_PASSWORD=evp_2025
ORACLE_CONNECTION_STRING=60.100.89.191:7971/SEVMQ
-# 기본 DOLCE 동기화 값
+# 기본 DOLCE 동기화 값 (60.100.99.217=dolce 개발, 60.100.98.68=dolce 운영영)
SYNC_DOLCE_URL=http://60.100.99.217:1111/
SYNC_DOLCE_BATCH=150 # 없으면 100으로 fallback
SYNC_DOLCE_TOKEN=
+SYNC_DOLCE_ENABLED=true
+DOLCE_UPLOAD_ENABLED=true
# 기본 SWP 동기화 값
SYNC_SWP_URL=https://swp.example.com/api/documents
SYNC_SWP_BATCH=200
SYNC_SWP_TOKEN=
+SYNC_SWP_ENABLED=true
+
IMPORT_DOLCE_ENABLED=true
DOLCE_API_URL=http://60.100.99.217:1111
@@ -111,7 +115,6 @@ S_GIPS_RSA_KEY="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtHC28Gw0U8taUwI8oJtG
# === SOAP 인터페이스 설정 ===
# MDG SOAP 인증 정보 (개발/품질/운영 비밀번호가 다름)
-MDG_SOAP_AUTH_TYPE=wssecurity # 'basic' 또는 'wssecurity'
MDG_SOAP_USERNAME=P2038_01 # 개발/품질/운영 공통
# MDG_SOAP_PASSWORD=STG4857602 # 개발
MDG_SOAP_PASSWORD=SEW2765890 # 품질
diff --git a/.env.production b/.env.production
index 7c960fa0..5dfb79f2 100644
--- a/.env.production
+++ b/.env.production
@@ -46,6 +46,9 @@ SYNC_DOLCE_URL=http://60.100.99.217:1111/
SYNC_DOLCE_BATCH=150 # 없으면 100으로 fallback
SYNC_DOLCE_TOKEN=
+SYNC_DOLCE_ENABLED=true
+DOLCE_UPLOAD_ENABLED=true
+
# 기본 SWP 동기화 값
SYNC_SWP_URL=https://swp.example.com/api/documents
@@ -113,7 +116,6 @@ S_GIPS_RSA_KEY="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtHC28Gw0U8taUwI8oJtG
# === SOAP 인터페이스 설정 ===
# MDG SOAP 인증 정보 (개발/품질/운영 비밀번호가 다름)
-MDG_SOAP_AUTH_TYPE=wssecurity # 'basic' 또는 'wssecurity'
MDG_SOAP_USERNAME=P2038_01 # 개발/품질/운영 공통
# MDG_SOAP_PASSWORD=STG4857602 # 개발
MDG_SOAP_PASSWORD=SEW2765890 # 품질
diff --git a/app/[lng]/partners/(partners)/document-list-ship/page.tsx b/app/[lng]/partners/(partners)/document-list-ship/page.tsx
index 82f14ad8..ad3bf30d 100644
--- a/app/[lng]/partners/(partners)/document-list-ship/page.tsx
+++ b/app/[lng]/partners/(partners)/document-list-ship/page.tsx
@@ -5,7 +5,7 @@ import { getValidFilters } from "@/lib/data-table"
import { Skeleton } from "@/components/ui/skeleton"
import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton"
import { Shell } from "@/components/shell"
-import { searchParamsRfqsForVendorsCache } from "@/lib/rfqs/validations"
+import { searchParamsShipDocuCache } from "@/lib/vendor-document-list/validations"
import { getServerSession } from "next-auth"
import { authOptions } from "@/app/api/auth/[...nextauth]/route"
import Link from "next/link"
@@ -20,7 +20,7 @@ interface IndexPageProps {
export default async function IndexPage(props: IndexPageProps) {
const searchParams = await props.searchParams
- const search = searchParamsRfqsForVendorsCache.parse(searchParams)
+ const search = searchParamsShipDocuCache.parse(searchParams)
const validFilters = getValidFilters(search.filters)
// Get session
diff --git a/lib/vendor-document-list/dolce-upload-service.ts b/lib/vendor-document-list/dolce-upload-service.ts
index 54672f33..d98a4c70 100644
--- a/lib/vendor-document-list/dolce-upload-service.ts
+++ b/lib/vendor-document-list/dolce-upload-service.ts
@@ -3,6 +3,7 @@ import db from "@/db/db"
import { documents, revisions, documentAttachments, contracts, projects, vendors, issueStages } from "@/db/schema"
import { eq, and, desc, sql, inArray, min } from "drizzle-orm"
import { v4 as uuidv4 } from "uuid"
+import path from "path"
export interface DOLCEUploadResult {
success: boolean
diff --git a/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx b/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx
index 508d8c91..c3b7251c 100644
--- a/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx
+++ b/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx
@@ -13,16 +13,37 @@ import { ImportFromDOLCEButton } from "./import-from-dolce-button"
interface EnhancedDocTableToolbarActionsProps {
table: Table<SimplifiedDocumentsView>
projectType: "ship" | "plant"
+ contractId?: number
}
export function EnhancedDocTableToolbarActions({
table,
projectType,
+ contractId,
}: EnhancedDocTableToolbarActionsProps) {
const [bulkUploadDialogOpen, setBulkUploadDialogOpen] = React.useState(false)
// 현재 테이블의 모든 데이터 (필터링된 상태)
const allDocuments = table.getFilteredRowModel().rows.map(row => row.original)
+
+ // 모든 문서에서 고유한 contractId들 추출
+ const contractIds = React.useMemo(() => {
+ const ids = new Set(allDocuments.map(doc => doc.contractId))
+ return Array.from(ids)
+ }, [allDocuments])
+
+ // 주요 contractId (가장 많은 문서가 속한 계약)
+ const primaryContractId = React.useMemo(() => {
+ if (contractId) return contractId
+ if (contractIds.length === 0) return undefined
+
+ const contractCounts = contractIds.map(id => ({
+ id,
+ count: allDocuments.filter(doc => doc.contractId === id).length
+ }))
+
+ return contractCounts.sort((a, b) => b.count - a.count)[0].id
+ }, [contractId, contractIds, allDocuments])
const handleSyncComplete = () => {
// 동기화 완료 후 테이블 새로고침
@@ -77,12 +98,13 @@ export function EnhancedDocTableToolbarActions({
</Button>
{/* Send to SHI 버튼 (공통) - 내부 → 외부로 보내기 */}
- {/* <SendToSHIButton
- contractId={selectedPackageId}
- documents={allDocuments}
- onSyncComplete={handleSyncComplete}
- projectType={projectType}
- /> */}
+ {primaryContractId && (
+ <SendToSHIButton
+ contractId={primaryContractId}
+ onSyncComplete={handleSyncComplete}
+ projectType={projectType}
+ />
+ )}
</div>