summaryrefslogtreecommitdiff
path: root/lib/vendor-document-list/enhanced-document-service.ts
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-11-02 19:06:08 +0900
committerjoonhoekim <26rote@gmail.com>2025-11-02 19:06:08 +0900
commit98d178c8fe20a61a87e5d8f20e7d310ff6fefd6b (patch)
treebb59e6472a8d85acf8c3b58425daf01d148c3ee4 /lib/vendor-document-list/enhanced-document-service.ts
parent7e86ecb9d3df7f554f82a8d5fdd538d1c148ce73 (diff)
(김준회) dolce: 도면구분을 서버사이드에서 처리하도록 변경
Diffstat (limited to 'lib/vendor-document-list/enhanced-document-service.ts')
-rw-r--r--lib/vendor-document-list/enhanced-document-service.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/vendor-document-list/enhanced-document-service.ts b/lib/vendor-document-list/enhanced-document-service.ts
index e5cce1b1..96a5ecff 100644
--- a/lib/vendor-document-list/enhanced-document-service.ts
+++ b/lib/vendor-document-list/enhanced-document-service.ts
@@ -1059,12 +1059,30 @@ export async function getDocumentDetails(documentId: number) {
ilike(simplifiedDocumentsView.vendorDocNumber, searchTerm),
)
}
+
+ // 4.5. B4 필터 처리 (drawingMoveGbn 기반)
+ let b4FilterWhere
+ if (input.b4FilterType && input.b4FilterType !== 'all') {
+ if (input.b4FilterType === 'gtt_deliverable') {
+ b4FilterWhere = eq(simplifiedDocumentsView.drawingMoveGbn, '도면입수')
+ } else if (input.b4FilterType === 'shi_input') {
+ b4FilterWhere = eq(simplifiedDocumentsView.drawingMoveGbn, '도면제출')
+ }
+ }
+
+ // 4.6. Project Code 필터 처리
+ let projectCodeWhere
+ if (input.projectCode && input.projectCode !== 'all') {
+ projectCodeWhere = eq(simplifiedDocumentsView.projectCode, input.projectCode)
+ }
// 5. 최종 WHERE 조건 (계약 ID들로 필터링)
const finalWhere = and(
eq(simplifiedDocumentsView.vendorId, Number(companyId)),
advancedWhere,
globalWhere,
+ b4FilterWhere,
+ projectCodeWhere,
)
// 6. 정렬 처리